CircuitPython - Trying to set pin value
from TheButtonJustSpins@infosec.pub to python@programming.dev on 07 Sep 2024 23:13
https://infosec.pub/post/17249298
from TheButtonJustSpins@infosec.pub to python@programming.dev on 07 Sep 2024 23:13
https://infosec.pub/post/17249298
New to CircuitPython, this feels like it should work according to the docs but it prints six False
s. Any ideas?
#!/usr/bin/env python import board import digitalio import time class body_controller: def __init__(self): SWDIO = board.D5 self._reset_pin = digitalio.DigitalInOut(SWDIO) print(self._reset_pin.value) self._reset_pin.switch_to_output(True) print(self._reset_pin.value) def turn_on(self): print(self._reset_pin.value) self._reset_pin.value = False print(self._reset_pin.value) time.sleep(1) print(self._reset_pin.value) self._reset_pin.value = True print(self._reset_pin.value) body = body_controller() time.sleep(1) body.turn_on() time.sleep(1)
#python
threaded - newest
Looks like pin 5 is no good for this; switched to pin 19 and all is well.