Herunterladen Inhalt Inhalt Diese Seite drucken

SunFounder Da Vinci Kit Bedienungsanleitung Seite 385

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

SRCLK
=
18
placePin
=
(10, 22, 27, 17)
number
=
(0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x90)
counter
=
0
timer
=0
gameState
=0
clearDisplay():
def
for
i
in
range(8):
GPIO.output(SDI, 1)
GPIO.output(SRCLK, GPIO.HIGH)
GPIO.output(SRCLK, GPIO.LOW)
GPIO.output(RCLK, GPIO.HIGH)
GPIO.output(RCLK, GPIO.LOW)
def
hc595_shift(data):
for
i
in
range(8):
GPIO.output(SDI,
GPIO.output(SRCLK, GPIO.HIGH)
GPIO.output(SRCLK, GPIO.LOW)
GPIO.output(RCLK, GPIO.HIGH)
GPIO.output(RCLK, GPIO.LOW)
def
pickDigit(digit):
for
i
in
placePin:
GPIO.output(i,GPIO.LOW)
GPIO.output(placePin[digit], GPIO.HIGH)
def
display():
global
counter
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
stateChange():
global
gameState
global
counter
global
timer1
if
gameState
==
counter
=
0
time.sleep(1)
timer()
elif
gameState ==1:
1.9. 3 Erweiterung
0x80
&
(data
<<
%
10])
%
100//10])
%
1000//100]-0x80)
%
10000//1000])
0:
i))
SunFounder Da Vinci Kit
(Fortsetzung der vorherigen Seite)
(Fortsetzung auf der nächsten Seite)
381

Werbung

Inhaltsverzeichnis
loading

Verwandte Produkte für SunFounder Da Vinci Kit

Diese Anleitung auch für:

Davinci-kit-for-raspberry-pi

Inhaltsverzeichnis