控制任务和要求 让一个LED灯闪烁 接线 程序设计 1 int half_cycle=1000; // define the cycle time of LED blink 2 int LED_pin=13; // define the LED pin 3 4 // the setup function runs once when you press reset or power the board 5 void setup() 6 { 7 pinMode(LED_pin, OUTPUT);
2018-03-1220:14:00 import pyb import time from pyb import Pin xlights = (pyb.LED(2),pyb.LED(3)) MO = Pin('X1',Pin.OUT_PP) accel = pyb.Accel() i = 0.0001 while True: x = accel.x() print("x=") print(x) # 获取到陀螺仪x数据 Y = x+20 MO.high() time.sleep(i*Y