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

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()  
screen shot 2017-10-06 @ 18.39.12.png
screen shot 2017-10-06 @ 18.39.12.png (50.46 kib) viewed 719 times
screen shot 2017-10-06 @ 18.16.04.png
screen shot 2017-10-06 @ 18.16.04.png (35.43 kib) viewed 719 times

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


raspberrypi



Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'