Add a few scripts to the list I had thrown on the pi pico already.
Working on Lights on and off at intervals. Not sure how I want to format it. I'll probably have different scripts and a text file with variables that can be loaded remotely or something. Maybe call each script into the main.py so main.py doesn't get god awfully long. On branch main Your branch is up to date with 'origin/main'. Changes to be committed: new file: Scripts/Flash-on-board-and-led.py modified: Scripts/Lights-on-off-intervals.py new file: Scripts/blink-onboard-led.py new file: Scripts/flashing-led.py new file: Scripts/flowing-lights.py new file: Scripts/led-blink.py new file: Scripts/lightOn.py new file: Scripts/main.py new file: Scripts/pwm.py new file: Scripts/random-number.py new file: Scripts/rgb-led-randomcolor.py
This commit is contained in:
11
Scripts/Flash-on-board-and-led.py
Normal file
11
Scripts/Flash-on-board-and-led.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from machine import Pin, Timer
|
||||
|
||||
ledMachine = machine.Pin("LED", machine.Pin.OUT)
|
||||
led = Pin(12, Pin.OUT)
|
||||
timer = Timer()
|
||||
|
||||
def blink(timer):
|
||||
led.toggle()
|
||||
ledMachine.toggle()
|
||||
|
||||
timer.init(freq=2.5, mode=Timer.PERIODIC, callback=blink)
|
||||
Reference in New Issue
Block a user