From acb6babd7fc2d84b5e3b1eb7a7533f5cdbda17e7 Mon Sep 17 00:00:00 2001 From: Edward Bigos Date: Tue, 7 Apr 2026 08:09:12 -0400 Subject: [PATCH] Lab 10 update --- Lab10/MicroPython/Code/blink_external.py | 27 ++++++++++++++++++++++++ Lab10/MicroPython/Code/blink_internal.py | 18 ++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 Lab10/MicroPython/Code/blink_external.py create mode 100644 Lab10/MicroPython/Code/blink_internal.py diff --git a/Lab10/MicroPython/Code/blink_external.py b/Lab10/MicroPython/Code/blink_external.py new file mode 100644 index 0000000..f90cf79 --- /dev/null +++ b/Lab10/MicroPython/Code/blink_external.py @@ -0,0 +1,27 @@ +# Micropython version of the blink program + +import machine +import time + +print("\nMicroPython example code") +print("Blink the onboard LED and LED's connected to GP15 & GP16\n") + +led = machine.Pin('LED', machine.Pin.OUT) #configure LED Pin as an output pin and create and led object for Pin class +# Configure GP15 +led15 = machine.Pin('GP15', machine.Pin.OUT) #configure LED Pin as an output pin and create and led object for Pin class +# Configure GP16 +led16 = machine.Pin('GP16', machine.Pin.OUT) #configure LED Pin as an output pin and create and led object for Pin class + +while True: + print("On") + led.value(True) #turn on the LED + led15.value(True) #turn on the LED + led16.value(True) #turn on the LED + time.sleep(1) #wait for one second + print("Off") + led.value(False) #turn off the LED + led15.value(False) #turn off the LED + led16.value(False) #turn off the LED + time.sleep(1) #wait for one second + + diff --git a/Lab10/MicroPython/Code/blink_internal.py b/Lab10/MicroPython/Code/blink_internal.py new file mode 100644 index 0000000..e9821db --- /dev/null +++ b/Lab10/MicroPython/Code/blink_internal.py @@ -0,0 +1,18 @@ +# Micropython version of the blink program + +import machine +import time + +print("\nMicroPython example code") +print("Blink the onboard LED\n") + +led = machine.Pin('LED', machine.Pin.OUT) #configure LED Pin as an output pin and create and led object for Pin class + +while True: + print("On") + led.value(True) #turn on the LED + time.sleep(1) #wait for one second + print("Off") + led.value(False) #turn off the LED + time.sleep(1) #wait for one second +