Skip to content

Commit 21c5731

Browse files
committed
Vertical Garden Code Update
Added a button debounce
1 parent dbee9b9 commit 21c5731

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

Vertical_Garden_Barometer/code.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
66
Code by Erin St Blaine for Adafruit Industries
77
"""
8-
<<<<<<< HEAD
98
import time
10-
=======
11-
12-
>>>>>>> origin/master
139
import board
1410
import neopixel
1511
from adafruit_clue import clue
@@ -54,11 +50,8 @@
5450
counter = 0
5551
toggle = 1 # for on/off switch on button A
5652
displayOn = 1 # to turn the display on and off with button B
57-
<<<<<<< HEAD
5853
button_b_pressed = False
5954
button_a_pressed = False
60-
=======
61-
>>>>>>> origin/master
6255

6356
clue.display.brightness = 0.8
6457
clue_display = displayio.Group(max_size=4)
@@ -109,11 +102,7 @@
109102
icePalette = [0x8080FF, 0x8080FF, 0x8080FF, 0x0000FF, 0xC88AFF]
110103
sunPalette = [0xffaa00, 0xffdd00, 0x7d5b06, 0xfffca8]
111104
firePalette = [0xff0000, 0xff5500, 0x8a3104, 0xffaa00 ]
112-
<<<<<<< HEAD
113105
forestPalette = [0x76DB00, 0x69f505, 0x05f551, 0x3B6D00]
114-
=======
115-
forestPalette = [0xccffa8, 0x69f505, 0x05f551, 0x2c8247]
116-
>>>>>>> origin/master
117106

118107
# set up default initial palettes, just for startup
119108
palette = forestPalette
@@ -139,7 +128,6 @@
139128
toggle = 1
140129
pixels.brightness = 1.0
141130
clue.display.brightness = 0.8
142-
<<<<<<< HEAD
143131
button_a_pressed = True # Set to True.
144132
time.sleep(0.03) # Debounce.
145133
if not clue.button_a and button_a_pressed: # On button release...
@@ -148,10 +136,6 @@
148136
if clue.button_b and not button_b_pressed: # If button B pressed...
149137
print("Button B pressed.")
150138
# Toggle only the display on and off
151-
=======
152-
if clue.button_b:
153-
# Toggle only the display on and off
154-
>>>>>>> origin/master
155139
if displayOn == 0:
156140
clue.display.brightness = 0.8
157141
displayOn = 1
@@ -256,11 +240,7 @@
256240
reading3_label.y = 194
257241
timer_label.y = 224
258242
# if reading is falling, show sinking image and position text at the top
259-
<<<<<<< HEAD
260243
elif reading1 < reading2: #reading is falling
261-
=======
262-
elif reading2 < reading3: #reading is falling
263-
>>>>>>> origin/master
264244
sinking_sprite.x = 0
265245
reading_label.y = 24
266246
reading2_label.y = 54

0 commit comments

Comments
 (0)