Skip to content

Commit 30a3084

Browse files
committed
Set GPIO numbering mode
1 parent 867f920 commit 30a3084

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

octoprint_filamentreload/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def after_resume_gcode(self):
4545

4646
def on_after_startup(self):
4747
self._logger.info("Filament Sensor Reloaded started")
48+
if self.mode == 0:
49+
GPIO.setmode(GPIO.BOARD)
50+
else:
51+
GPIO.setmode(GPIO.BCM)
4852
if self.sensor_enabled():
4953
self._logger.info("Filament Sensor active on GPIO Pin [%s]"%self.pin)
5054
GPIO.setup(self.pin, GPIO.IN, pull_up_down=GPIO.PUD_UP) # Initialize GPIO as INPUT

0 commit comments

Comments
 (0)