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:
2023-12-17 13:29:10 -05:00
parent 5a4c60b897
commit 9723de2b8c
11 changed files with 185 additions and 2 deletions

22
Scripts/flowing-lights.py Normal file
View File

@@ -0,0 +1,22 @@
from machine import Pin,PWM
from pwm import myPWM
import time
mypwm = myPWM(16, 17, 18, 19, 20, 21, 22, 26, 27, 28)
chns = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
dutys = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65535, 32768, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
delayTimes = 50
try:
while True:
for i in range(0, 20):
for j in range(0, 10):
mypwm.ledcWrite(chns[j], dutys[i+j])
time.sleep_ms(delayTimes)
for i in range(0, 20):
for j in range(0, 10):
mypwm.ledcWrite(chns[9 -j], dutys[i+j])
time.sleep_ms(delayTimes)
except:
mypwm.deinit()