File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -245,11 +245,13 @@ def motion_distance_cm(self):
245245
246246 # Button Methods
247247 def config_button (self , pin ):
248- self ._send (f"register:bt::{ pin } " )
248+ self ._send (f"register:: bt::{ pin } " )
249249 self ._add_pin (ComponentPins .BUTTON , pin )
250250
251251 def is_button_pressed (self , pin ):
252- return self ._find_sensor_str (pin , "bt" ) == "0"
252+ # The firmware will return 1 if the pin is LOW
253+ # This works because we always use pullup resistor.
254+ return self ._find_sensor_str (pin , "bt" ) == "1"
253255
254256 # Servo Methods
255257 def config_servo (self , pin ):
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44
55[project ]
66name = " electroblocks"
7- version = " 0.1.19 "
7+ version = " 0.1.20 "
88description = " Python client library to interact with ElectroBlocks Arduino firmware"
99authors = [
1010 {
name =
" Noah Glaser" ,
email =
" [email protected] " }
You can’t perform that action at this time.
0 commit comments