-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathid.py
40 lines (30 loc) · 855 Bytes
/
id.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import sys
# import RPi.GPIO as GPIO
# import consts
# Should return R1, R2, R3, B1, B2, or B3 for FMS
# GPIO.setup([consts.ID_PLUS_1_PIN, consts.ID_PLUS_2_PIN, consts.ID_RED_BLUE_PIN], GPIO.IN, pull_up_down=GPIO.PUD_UP)
def getPlus1() :
# return GPIO.input(consts.ID_PLUS_1_PIN)
pass
def getPlus2() :
# return GPIO.input(consts.ID_PLUS_2_PIN)
pass
def getRedBlue() :
# return GPIO.input(consts.ID_RED_BLUE_PIN)
pass
def getID() -> str :
return ("R" if isRed() else "B") + str(numberID)
def getNumberID() -> int :
return numberID
def isRed() -> bool :
return redBlue
def changeID(id: int, red: bool) :
pass
try :
numberID = int(sys.argv[1])
redBlue = bool(sys.argv[2])
except :
numberID = (not getPlus1()) + ((not getPlus2()) << 1)
redBlue = not getRedBlue()
print(numberID)
print(redBlue)