Skip to content

Commit

Permalink
gpio error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ArttuKuikka committed Jan 13, 2024
1 parent 10a5acf commit 3c49f0b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def setLed(r, g, b, duration):
green_led.value = g
blue_led.value = b
sleep(duration)
except gpiozero.exc.GPIOPinInUse:
print('GPIO in use already')
finally:
red_led.close()
green_led.close()
Expand Down

0 comments on commit 3c49f0b

Please sign in to comment.