Update code.py
update with internal pullups and move to ports 1-4
@@ -10,14 +10,14 @@ ss = crickit.seesaw
# four buttons with pullups, connect to ground to activate
BUTTON_1 = crickit.SIGNAL1 # button #1 connected to signal port 1 & ground
-BUTTON_2 = crickit.SIGNAL3 # button #2 connected to signal port 3 & ground
-BUTTON_3 = crickit.SIGNAL5 # button #3 connected to signal port 5 & ground
-BUTTON_4 = crickit.SIGNAL7 # button #4 connected to signal port 7 & ground
+BUTTON_2 = crickit.SIGNAL2 # button #2 connected to signal port 2 & ground
+BUTTON_3 = crickit.SIGNAL3 # button #3 connected to signal port 3 & ground
+BUTTON_4 = crickit.SIGNAL4 # button #4 connected to signal port 4 & ground
-ss.pin_mode(BUTTON_1, ss.INPUT)
-ss.pin_mode(BUTTON_2, ss.INPUT)
-ss.pin_mode(BUTTON_3, ss.INPUT)
-ss.pin_mode(BUTTON_4, ss.INPUT)
+ss.pin_mode(BUTTON_1, ss.INPUT_PULLUP) # Set as input with a pullup resistor
+ss.pin_mode(BUTTON_2, ss.INPUT_PULLUP)
+ss.pin_mode(BUTTON_3, ss.INPUT_PULLUP)
+ss.pin_mode(BUTTON_4, ss.INPUT_PULLUP)
while True:
if not ss.digital_read(BUTTON_1):
