import gamebuino_meta as gb
import time
gb.waitForUpdate()
gb.lights.clear( gb.color.RED )
time.sleep(0.5)
gb.waitForUpdate()
gb.lights.clear( gb.color.GREEN )
time.sleep(0.5)
gb.waitForUpdate()
gb.lights.clear( gb.color.BLUE )
time.sleep(0.5)
gb.waitForUpdate()
gb.lights.clear()
time.sleep(0.5)
gb.waitForUpdate()
import gamebuino_meta as gb
import math
def rgb565(r,g,b):
r2 = math.floor( r / 256 * 31 )
g2 = math.floor( g / 256 * 64 )
b2 = math.floor( b / 256 * 31 )
return (r2 << 11) | (g2 << 5) | b2
r = 0
while True:
gb.waitForUpdate()
gb.lights.fill( rgb565(0,0, math.sin(math.radians(r))*127+127 ) )
r = ( r + 2 ) % 360
import gamebuino_meta as gb
import math,time
def rgb565(r,g,b):
r2 = math.floor( r / 256 * 31 )
g2 = math.floor( g / 256 * 64 )
b2 = math.floor( b / 256 * 31 )
return (r2 << 11) | (g2 << 5) | b2
while True:
for x in range(2):
for y in range(4):
gb.waitForUpdate()
gb.display.clear()
gb.lights.clear()
gb.display.print( "lights x: " + str(x) + " y: " + str(y) )
gb.lights.drawPixel( x, y, rgb565(0,255,0) )
time.sleep(0.2)