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)
You must log in or register to comment.
Looks like pin 5 is no good for this; switched to pin 19 and all is well.