MY9221 - Grove LED Bar

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
Post Reply
User avatar
mcauser
Posts: 411
Joined: Mon Jun 15, 2015 8:03 am

MY9221 - Grove LED Bar

Post by mcauser » Thu Jan 25, 2018 3:57 pm

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]))

BruinBear
Posts: 27
Joined: Sat Jan 14, 2017 11:59 am

Re: MY9221 - Grove LED Bar

Post by BruinBear » Tue Jul 17, 2018 10:29 pm

Very nice! Thanks for that.

User avatar
mcauser
Posts: 411
Joined: Mon Jun 15, 2015 8:03 am

Re: MY9221 - Grove LED Bar

Post by mcauser » Tue Jul 17, 2018 11:50 pm

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

BruinBear
Posts: 27
Joined: Sat Jan 14, 2017 11:59 am

Re: MY9221 - Grove LED Bar

Post by BruinBear » Wed Jul 18, 2018 9:09 pm

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.

User avatar
mcauser
Posts: 411
Joined: Mon Jun 15, 2015 8:03 am

Re: MY9221 - Grove LED Bar

Post by mcauser » Wed Jul 18, 2018 11:38 pm


BruinBear
Posts: 27
Joined: Sat Jan 14, 2017 11:59 am

Re: MY9221 - Grove LED Bar

Post by BruinBear » Thu Jul 19, 2018 8:23 am

Nice!

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

rhubarbdog
Posts: 166
Joined: Tue Nov 07, 2017 11:45 pm

Re: MY9221 - Grove LED Bar

Post by rhubarbdog » Sun Dec 02, 2018 6:42 am

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.

Post Reply