diff --git a/ch-2/blink.py b/ch-2/blink.py new file mode 100644 index 0000000..6b6c2b7 --- /dev/null +++ b/ch-2/blink.py @@ -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) diff --git a/ch-2/helloworld.py b/ch-2/helloworld.py new file mode 100644 index 0000000..1385fe3 --- /dev/null +++ b/ch-2/helloworld.py @@ -0,0 +1 @@ +print("Hello, world!") \ No newline at end of file diff --git a/ch-2/light_led.py b/ch-2/light_led.py new file mode 100644 index 0000000..5914659 --- /dev/null +++ b/ch-2/light_led.py @@ -0,0 +1,5 @@ +import board +import digitalio +led = digitalio.DigitalInOut(board.LED) +led.direction = digitalio.Direction.OUTPUT +led.value = True