删除 main.py

main
vcc_gnd gardener 2024-02-09 17:47:04 +08:00
parent a609c80487
commit 4095dfbbe1
1 changed files with 0 additions and 52 deletions

52
main.py
View File

@ -1,52 +0,0 @@
import time
import _thread
from pyb import LED
from pyb import Accel
import neopixel
accel = Accel()
p = machine.Pin.board.RGB
n = neopixel.NeoPixel(p, 1)
def funcA(sec):
time.sleep(sec)
while 1:
LED(1).toggle()
time.sleep(0.5)
LED(2).toggle()
time.sleep(0.5)
LED(3).toggle()
time.sleep(0.5)
LED(4).toggle()
time.sleep(0.5)
def funcC(sec):
time.sleep(sec)
while 1:
if accel.x()>=10:
n[0] = (18, 0, 0)
n.write()
elif accel.x()<=-10:
n[0] = (0, 0, 20)
n.write()
elif accel.x()<10 and accel.y()>-10:
n[0] = (0, 20, 0)
n.write()
time.sleep(0.2)
if __name__ == '__main__':
_thread.start_new_thread(funcA, (0.5,))
_thread.start_new_thread(funcC, (1,))