Page 1 of 1

MY9221 - Grove LED Bar

Posted: Thu Jan 25, 2018 3:57 pm
by mcauser
Ported my MicroPython MY9221 library to the micro:bit.
https://github.com/mcauser/microbit-my9221
https://github.com/mcauser/micropython-my9221

Code: Select all

from my9221 import MY9221
from machine import Pin
ledbar = MY9221(di=Pin(4), dcki=Pin(5))

ledbar.level(4, 0x0F)
ledbar.bits(0b1010101010)
ledbar.bytes(bytearray([0,1,3,7,15,31,63,127,255,255]))

Re: MY9221 - Grove LED Bar

Posted: Tue Jul 17, 2018 10:29 pm
by BruinBear
Very nice! Thanks for that.

Re: MY9221 - Grove LED Bar

Posted: Tue Jul 17, 2018 11:50 pm
by mcauser
If you're interested in the Grove modules, Seeed now have a Grove shield for micro:bit with an edge connector and breaks out 4 ports:
https://www.seeedstudio.com/Grove-Shiel ... -3083.html

Re: MY9221 - Grove LED Bar

Posted: Wed Jul 18, 2018 9:09 pm
by BruinBear
I know - I have one! They have produced a MakeCode package for the "Grove Inventor's Kit for micro:bit". The package includes support for the non-trivial devices in that Kit (Ultrasonic, 4x7-seg display and Gesture sensor). Very good stuff.

Would be good to couple the Grove LED bar with the Grove ultrasonic.

Unfortunately, the Grove LED Bar is not in the Kit so there are no MakeCode blocks for it. Likewise, I can't find a micropython module for the Grove ultrasonic. It uses "single pin mode" and Fizban's HCSR04 module uses separate trig and echo pins.

Re: MY9221 - Grove LED Bar

Posted: Wed Jul 18, 2018 11:38 pm
by mcauser

Re: MY9221 - Grove LED Bar

Posted: Thu Jul 19, 2018 8:23 am
by BruinBear
Nice!

You just need to work on the Grove ultrasonic module now :D

Re: MY9221 - Grove LED Bar

Posted: Sun Dec 02, 2018 6:42 am
by rhubarbdog
I've downloaded tm1637.py . It's pretty big. I'm able to execute a 4 line program

Code: Select all

from microbit import *
from tm1637 import TM1637
tm = TM1637(clk = pin1, dio = pin2)

tm.show('COOL')
But a simple thermometer using a tmp36 , a device which only uses microbit.read_analog()
I get memory errors.