Chapter 2

This commit is contained in:
Danny Staple 2021-08-17 10:28:59 +01:00
parent d5acb424e1
commit 375df187cb
3 changed files with 18 additions and 0 deletions

12
ch-2/blink.py Normal file
View File

@ -0,0 +1,12 @@
import time
import board
import digitalio
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.5)

1
ch-2/helloworld.py Normal file
View File

@ -0,0 +1 @@
print("Hello, world!")

5
ch-2/light_led.py Normal file
View File

@ -0,0 +1,5 @@
import board
import digitalio
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
led.value = True