Skip to content

Commit a610a2a

Browse files
authored
Merge branch 'master' into matrix-7-segment-led-backpack-merge
2 parents 1eb2dad + 8a81ff1 commit a610a2a

2 files changed

Lines changed: 11 additions & 15 deletions

File tree

Introducing_CircuitPlaygroundExpress/CircuitPlaygroundExpress_AnalogIn.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
# CircuitPlaygroundExpress_AnalogIn
2-
# reads the analog voltage level from a 10k potentiometer
3-
# connected to GND, 3.3V, and pin A1
4-
# and prints the results to the REPL
1+
# Circuit Playground AnalogIn
2+
# Reads the analog voltage level from a 10k potentiometer connected to GND, 3.3V, and pin A1
3+
# and prints the results to the serial console.
54

65
import time
7-
86
import board
9-
from analogio import AnalogIn
7+
import analogio
108

11-
analogin = AnalogIn(board.A1)
9+
analogin = analogio.AnalogIn(board.A1)
1210

1311

1412
def getVoltage(pin): # helper

Introducing_CircuitPlaygroundExpress/CircuitPlaygroundExpress_DigitalIO.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
# CircuitPlaygroundExpress_DigitalIO
1+
# Circuit Playground digitalio example
22

33
import time
4-
54
import board
6-
from digitalio import DigitalInOut, Direction, Pull
5+
import digitalio
76

8-
led = DigitalInOut(board.D13)
9-
led.direction = Direction.OUTPUT
7+
led = digitalio.DigitalInOut(board.D13)
8+
led.switch_to_output()
109

11-
button = DigitalInOut(board.BUTTON_A)
12-
button.direction = Direction.INPUT
13-
button.pull = Pull.DOWN
10+
button = digitalio.DigitalInOut(board.BUTTON_A)
11+
button.switch_to_input(pull=digitalio.Pull.DOWN)
1412

1513
while True:
1614
if button.value: # button is pushed

0 commit comments

Comments
 (0)