Here is the sample code ---------- ######### SAMPLE CODE FOR 7 SEGMENT DISPLAY ########### ### Setup the Raspberry Pi GPIO for USE # First import the GPIO module import RPi.GPIO as GPIO # Now set up GPIO using BCM numbering GPIO.setmode(GPIO.BCM) ### Assign the 7 segment variables that will map to each GPIO port # Note: Use the numbers based on how you wired up the Pi a=19 b=26 c=20 d=16 e=12 f=13 g=6 dot=21 ### Declare each GPIO port that will be used as an OUTPUT port GPIO.setup(a,GPIO.OUT) GPIO.setup(b,GPIO.OUT) GPIO.setup(c,GPIO.OUT) GPIO.setup(d,GPIO.OUT) GPIO.setup(e,GPIO.OUT) GPIO.setup(f,GPIO.OUT) GPIO.setup(g,GPIO.OUT) GPIO.setup(dot,GPIO.OUT) ### Turn on specific segments to make a number #Number 1 = b,c ON and everything else OFF GPIO.output(a,0) GPIO.output(b,1) GPIO.output(c,1) GPIO.output(d,0) GPIO.output(e,0) GPIO.output(f,0) GPIO.output(g,0) GPIO.output(dot,1)
so much usefull in 2021 lockdown days
THNX VERRY MUCH NEVER FOUND SOMETHING LIKE THIS, nice
You guys are awesome! Great Vid. Thanks.
Thanks for the tutorial!
Thanks for the comment, please feel free to share.
how did u get output as number 3?
I want a raspberry pi for christmas
great tutorial thanks!
Thanks for the comment, please share.
Here is the sample code
----------
######### SAMPLE CODE FOR 7 SEGMENT DISPLAY ###########
### Setup the Raspberry Pi GPIO for USE
# First import the GPIO module
import RPi.GPIO as GPIO
# Now set up GPIO using BCM numbering
GPIO.setmode(GPIO.BCM)
### Assign the 7 segment variables that will map to each GPIO port
# Note: Use the numbers based on how you wired up the Pi
a=19
b=26
c=20
d=16
e=12
f=13
g=6
dot=21
### Declare each GPIO port that will be used as an OUTPUT port
GPIO.setup(a,GPIO.OUT)
GPIO.setup(b,GPIO.OUT)
GPIO.setup(c,GPIO.OUT)
GPIO.setup(d,GPIO.OUT)
GPIO.setup(e,GPIO.OUT)
GPIO.setup(f,GPIO.OUT)
GPIO.setup(g,GPIO.OUT)
GPIO.setup(dot,GPIO.OUT)
### Turn on specific segments to make a number
#Number 1 = b,c ON and everything else OFF
GPIO.output(a,0)
GPIO.output(b,1)
GPIO.output(c,1)
GPIO.output(d,0)
GPIO.output(e,0)
GPIO.output(f,0)
GPIO.output(g,0)
GPIO.output(dot,1)
Awesome video.
Mine's not lighting up at all :( Any ideas why?
same, any solution??
Neither mine! And I followed your instructions exactly
same
what did type following the code sudo python number ......................then what?
Gracias ! :)
where the code?
เย้ๆ