Led Matrix - Raspberry Pi Forums
hi
allright drive led matrix using python code 1 below
include hardware setup , table made understand how light individual less
thanks
allright drive led matrix using python code 1 below
include hardware setup , table made understand how light individual less
thanks
code: select all
from gpiozero import led time import sleep pin14 = led(14) pin15 = led(15) pin8 = led(8) pin7 = led(7) def led_1_up(): pin14.on() pin15.on() pin8.off() pin7.off() def led_2_up(): pin14.off() pin15.on() pin8.on() pin7.off() def led_3_up(): pin14.on() pin15.off() pin8.off() pin7.on() def led_4_up(): pin14.off() pin15.off() pin8.on() pin7.on() def tempo(): sleep(1) while true: led_1_up() tempo() led_2_up() tempo() led_3_up() tempo() led_4_up() tempo()
i think it's better not ground components through gpio pins this. if want logic along lines: pin14 , not pin15 in code. if need hardware logic (which might if want run matrix bigger number of gpio pins) use transistor connect led ground. can check out current ratings of individual pins , in total on rpi datasheets.
ps there problems driving matrix - if wanted extend 4x4 or 8x6. circuit try switch led1, led2, led3 not led4
pps 'sharing' resisitors way means current drop when have 2 led lit - ideally have 1 resistor per led
ps there problems driving matrix - if wanted extend 4x4 or 8x6. circuit try switch led1, led2, led3 not led4
pps 'sharing' resisitors way means current drop when have 2 led lit - ideally have 1 resistor per led
raspberrypi
Comments
Post a Comment