Herunterladen Inhalt Inhalt Diese Seite drucken

SunFounder Da Vinci Kit Bedienungsanleitung Seite 78

Für den raspberry pi 4 modell b, 3 modell a +, 3 modell b +, 3 modell b, 2 modell b, 1 modell b +, 1 modell a +, zero w and zero
Inhaltsverzeichnis

Werbung

SunFounder Da Vinci Kit
GPIO.output(SDI,
GPIO.output(SRCLK, GPIO.HIGH)
GPIO.output(SRCLK, GPIO.LOW)
GPIO.output(RCLK, GPIO.HIGH)
GPIO.output(RCLK, GPIO.LOW)
pickDigit(digit):
def
for
i
in
placePin:
GPIO.output(i,GPIO.LOW)
GPIO.output(placePin[digit], GPIO.HIGH)
def
timer():
global
counter
global
timer1
timer1
=
threading.Timer(1.0, timer)
timer1.start()
counter
+=
1
print("%d"
%
counter)
def
loop():
global
counter
while
True:
clearDisplay()
pickDigit(0)
hc595_shift(number[counter
clearDisplay()
pickDigit(1)
hc595_shift(number[counter
clearDisplay()
pickDigit(2)
hc595_shift(number[counter
clearDisplay()
pickDigit(3)
hc595_shift(number[counter
def
setup():
GPIO.setmode(GPIO.BCM)
GPIO.setup(SDI, GPIO.OUT)
GPIO.setup(RCLK, GPIO.OUT)
GPIO.setup(SRCLK, GPIO.OUT)
for
i
in
placePin:
GPIO.setup(i, GPIO.OUT)
global
timer1
timer1
=
threading.Timer(1.0, timer)
timer1.start()
def
destroy():
# When "Ctrl+C" is pressed, the function is executed.
global
timer1
GPIO.cleanup()
timer1.cancel()
74
0x80
&
(data
<<
%
10])
%
100//10])
%
1000//100])
%
10000//1000])
# cancel the timer
i))
Kapitel 1. Über das Da Vinci Kit
(Fortsetzung der vorherigen Seite)
(Fortsetzung auf der nächsten Seite)

Werbung

Inhaltsverzeichnis
loading

Verwandte Produkte für SunFounder Da Vinci Kit

Diese Anleitung auch für:

Davinci-kit-for-raspberry-pi

Inhaltsverzeichnis