NodeMCU Projects: Difference between revisions
Content added Content deleted
Line 468: | Line 468: | ||
= MAX7219 based 8x8 LED Matrix = |
= MAX7219 based 8x8 LED Matrix = |
||
Source: [https://github.com/vrialland/micropython-max7219 github.com] |
|||
*Download below Library and upload it to NodeMCU: |
|||
https://github.com/vrialland/micropython-max7219/blob/master/max7219.py |
|||
* Static Testing: |
|||
<syntaxhighlight lang="python"> |
<syntaxhighlight lang="python"> |
||
from machine import Pin, SPI |
from machine import Pin, SPI |
||
Line 474: | Line 480: | ||
spi = SPI(1, baudrate=10000000) |
spi = SPI(1, baudrate=10000000) |
||
screen = max7219.Max7219(32, 8, spi, Pin(15)) |
screen = max7219.Max7219(32, 8, spi, Pin(15)) |
||
screen.text('ABCD', 0, 0, 1) |
screen.text('ABCD', 0, 0, 1) # |
||
screen.show() |
screen.show() |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
* Command explaination |
|||
screen.text("ABCD",x,y,z) |
|||
ABCD = Text to be displayed |
|||
x = Horizontal Position |
|||
y = Vertical Position |
|||
* Scroll Text: |
|||
<syntaxhighlight lang="python"> |
|||
for i in range(10): |
|||
screen.text("ABCD",i,0,1) |
|||
screen.show() |
|||
time.sleep(1) |
|||
screen.init_display() |
|||
</syntaxhighlight> |
|||
<br /> |
<br /> |