Skip to content

Commit 8232a96

Browse files
author
Mikey Sklar
committed
Continuous_Output.py - ported to python3 using CircuitPython libs, tested and runs
1 parent 4967003 commit 8232a96

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import time
2-
import RPi.GPIO as GPIO
3-
GPIO.setmode(GPIO.BCM)
2+
import board
3+
from digitalio import DigitalInOut, Direction
44

5-
padPin = 23
6-
GPIO.setup(padPin, GPIO.IN)
5+
pad_pin = board.D23
76

7+
pad = DigitalInOut(pad_pin)
8+
pad.direction = Direction.INPUT
89

910
while True:
10-
padPressed = GPIO.input(padPin)
1111

12-
if padPressed:
13-
print "pressed"
14-
15-
time.sleep(0.1)
12+
if pad.value:
13+
print("pressed")
1614

15+
time.sleep(0.1)

0 commit comments

Comments
 (0)