minor edits for Feather M4
This commit is contained in:
parent
0e37277da7
commit
42bb6eb392
3 changed files with 3 additions and 8 deletions
|
|
@ -1,7 +1,5 @@
|
|||
# CircuitPython AnalogIn Demo
|
||||
|
||||
import time
|
||||
|
||||
import board
|
||||
from analogio import AnalogIn
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
# CircuitPython IO demo - analog output
|
||||
|
||||
import board
|
||||
from analogio import AnalogOut
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +1,20 @@
|
|||
# CircuitPython IO demo #1 - General Purpose I/O
|
||||
|
||||
import time
|
||||
|
||||
import board
|
||||
from digitalio import DigitalInOut, Direction, Pull
|
||||
|
||||
led = DigitalInOut(board.D13)
|
||||
led.direction = Direction.OUTPUT
|
||||
|
||||
# For Gemma M0, Trinket M0, Metro M0 Express, ItsyBitsy M0 Express
|
||||
# For Gemma M0, Trinket M0, Metro M0 Express, ItsyBitsy M0 Express, Itsy M4 Express
|
||||
switch = DigitalInOut(board.D2)
|
||||
# switch = DigitalInOut(board.D5) # For Feather M0 Express
|
||||
# switch = DigitalInOut(board.D5) # For Feather M0 Express, Feather M4 Express
|
||||
# switch = DigitalInOut(board.D7) # For Circuit Playground Express
|
||||
switch.direction = Direction.INPUT
|
||||
switch.pull = Pull.UP
|
||||
|
||||
while True:
|
||||
# We could also just do "led.value = not switch.value"!
|
||||
# We could also do "led.value = not switch.value"!
|
||||
if switch.value:
|
||||
led.value = False
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue