November 15, 2024, 08:24:30 AM

MOD-LED8x8RGB - MicroPython driver

Started by mchobby, June 26, 2019, 02:31:54 PM

Previous topic - Next topic

mchobby

Hi there, I was trying to do a MicroPython portage for MOD-LED8x8RGB and was unable to get any results.
So, I wired it on an Arduino UNO and not getting any result either!

See Wiring picture here: https://imagebin.ca/v/4lvRkj3DadSo


Used the  /examples/Restless_Dancer.ino coming from Olimex GitHub
https://github.com/OLIMEX/UEXT-MODULES/tree/master/MOD-LED8x8RGB/ARDUINO%20EXAMPLE

because on a UNO, the #13 is the SCK SPI signal updated the lcd8x8rgb.h file (accordingly to the wiring) and change the following line

const char chipSelectPin = 13;

with

const char chipSelectPin = 10;

But nothing (absolutely nothing) happens on the matrix.

I checked the bus with a scope and data is flowing to the matrix.

See scope image capture with SPI data decoded https://imagebin.ca/v/4lvTmEm15ur8

Any suggestion?
Kind regards,
Dominique

LubOlimex

First I believe that you should be using EXT_IN connector, instead of EXT_OUT. EXT_OUT would be used in case you have more than one MOD-LED8x8RGB connected to each other!

Refer to 0:23 from this video for proper side to use for input (green arrow): https://youtu.be/EImDHxnk6Pw?t=23
Technical support and documentation manager at Olimex

mchobby

Ouch :o ! Damned! Shame on me! 

So focused on the connections and not able to read the text on the top of the connector!
:-[
Everything is right now!

Thank for the tip.

mchobby

After my stupid quesion... the MicroPython driver is on its way  :) .

Wiring with MicroPython Pyboard

Primary test results are visibles here on the GitHub https://github.com/mchobby/esp8266-upy/blob/master/modled8x8/readme_ENG.md

from machine import Pin, SPI
from modledraw import ModLedRGBraw

# Initialize the SPI Bus (on ESP8266-EVB)
# Software SPI
#    spi = SPI(-1, baudrate=4000000, polarity=1, phase=0, sck=Pin(14), mosi=Pin(13), miso=Pin(12))
# Hardware SPI on Pyboard
spi = SPI(2) # MOSI=Y8, MISO=Y7, SCK=Y6, SS=Y5
spi.init( baudrate=2000000, phase=0, polarity=0 ) # low @ 2 MHz
# We must manage the SS signal ourself
ss = Pin( Pin.board.Y5, Pin.OUT )

modled = ModLedRGBraw( spi, ss ) # Just one LED brick LED-8x8RGB
modled.drawPixel( 1,1, color=1 ) # Red
modled.drawPixel( 2,2, color=2 ) # Green
modled.drawPixel( 3,3, color=4 ) # Blue
modled.drawPixel( 4,8, color=3 ) # Red + Green = Yellow
modled.drawPixel( 5,8, color=5 ) # Red + Blue  = Magenta
modled.drawPixel( 6,7, color=6 ) # Green + Blue  = Cyan
modled.drawPixel( 7,6, color=7 ) # Red + Green + Blue  = White
modled.show()




I will order more MOD-LED8x8RGB to test digital signage while developping the driver against MicroPython FrameBuffer