Example #1
0
import neo_color, neo_img
import oled, mb
from microbit import *

grps = (1, )
neo_color.setup(grps, addr=SLOT)
for row in range(4):
    pool = [mb.get_type(chr(ord('a') + row * 4 + i)) for i in range(4)]
    oled.show(row * 2, 0, pool)
display.show(Image.HAPPY)

while 1:
    for i in range(24):
        neo_color.set_pixel(0, i, (i * 2, i * 2, 48 - i * 2))
    for i in range(24):
        neo_color.set_pixel(0, i, (0, 0, 0))
Example #2
0
import neo_color
import mb
from microbit import *

grps = (1, 3, 2)
neo_color.setup(grps)
display.show(Image.HAPPY)

##def _exe(s,b,l,r):
##    try:
##        i2c.write(s,b)
##        if l:
##            try:
##                d=i2c.read(s,l)
##                if not r:
##                    d=int.from_bytes(d,'big')
##                display.show(LIGHT)
##                sleep(50)
##                display.clear()
##                return d
##            except:
##                display.scroll('R',delay=50)
##    except:
##        display.scroll('W',delay=50)
##mb._exe=_exe
pool_set1 = ((255, 255, 0), (0, 100, 0), (0, 0, 100)) * 8
pool_set2 = ((100, 80, 0), (0, 100, 80), (80, 0, 100)) * 10
pool_clear1 = ((0, 0, 0), ) * 24
pool_clear2 = ((0, 0, 0), ) * 30

G = 2