<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Super simple RGB mixer]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1612452240997-img_20210204_162014-resized.jpg" alt="0_1612452214674_IMG_20210204_162014.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">My first time working with this hardware and UIflow / uPython I made a super simple RGB mixer.</p>
<p dir="auto">(ty felmue for teaching me how to format code)</p>
<pre><code>from m5stack import 
from m5ui import 
from uiflow import 

setScreenColor(0x222222)

varBarFactor = None
varR = None
varG = None
varB = None
varHexR = None
varHexG = None
varHexB = None

lb_RGBval = M5TextBox(26, 8, RGB, lcd.FONT_UNICODE, 0xFFFFFF, rotate=90)
rec_R = M5Rect(44, 240, 50, 0, 0xff0000, 0xff0000)
rec_G = M5Rect(133, 240, 50, 0, 0x00ff00, 0x00ff00)
rec_B = M5Rect(224, 240, 50, 0, 0x0000ff, 0x0000ff)

def workR()
  global varBarFactor, varR, varG, varB, varHexR, varHexG, varHexB
  if btnA.isPressed()
    varR = varR + 1
    if varR  255
      varR = 0
    rec_R.setSize(height=int((varR  varBarFactor)))
    rec_R.setPosition(y=(240 - int((varR  varBarFactor))))
    varHexR = str(hex(varR))[2]
    if len(varHexR)  2
      varHexR = (str('0') + str(varHexR))

def workG()
  global varBarFactor, varR, varG, varB, varHexR, varHexG, varHexB
  if btnB.isPressed()
    varG = varG + 1
    if varG  255
      varG = 0
    rec_G.setSize(height=int((varG  varBarFactor)))
    rec_G.setPosition(y=(240 - int((varG  varBarFactor))))
    varHexG = str(hex(varG))[2]
    if len(varHexG)  2
      varHexG = (str('0') + str(varHexG))

def workB()
  global varBarFactor, varR, varG, varB, varHexR, varHexG, varHexB
  if btnC.isPressed()
    varB = varB + 1
    if varB  255
      varB = 0
    rec_B.setSize(height=int((varB  varBarFactor)))
    rec_B.setPosition(y=(240 - int((varB  varBarFactor))))
    varHexB = str(hex(varB))[2]
    if len(varHexB)  2
      varHexB = (str('0') + str(varHexB))

lcd.setBrightness(10)
varBarFactor = 0.95
varHexR = '00'
varHexG = '00'
varHexB = '00'
varR = 0
varG = 0
varB = 0
while True
  workR()
  workG()
  workB()
  rgb.setColorAll((varR  16)  (varG  8)  varB)
  lb_RGBval.setText(str((str('RGB #') + str(((str(varHexR) + str(((str(varHexG) + str(varHexB))))))))))
  wait_ms(2)
</code></pre>
]]></description><link>https://community.m5stack.com/topic/2889/super-simple-rgb-mixer</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Mar 2026 15:09:26 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2889.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 04 Feb 2021 15:27:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Super simple RGB mixer on Thu, 04 Feb 2021 16:44:00 GMT]]></title><description><![CDATA[<p dir="auto">Hello @LasNiko</p>
<p dir="auto">nice project!</p>
<p dir="auto">You can use three backticks before and after the code. Full description <a href="https://commonmark.org/help/" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/12290</link><guid isPermaLink="true">https://community.m5stack.com/post/12290</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 04 Feb 2021 16:44:00 GMT</pubDate></item></channel></rss>