主要内容
#include

#define LED_PIN 6
#define LED_NUM 2

#define Light_PIN A0

ColorLED strip = ColorLED(LED_NUM,LED_PIN);

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(Light_PIN,INPUT);
}

void loop() {
// put your main code here, to run repeatedly:
int Light = analogRead(Light_PIN);
if (Light > 800){
strip.setPixelColor(0,255,0,0);
strip.show();
delay(2000);
} else {
strip.setPixelColor(0,0);
strip.show();
}
Serial.print("Light=");
Seriai.println(Light);
delay(100);
}
代码展示
暂无数据!
附件下载
暂无数据!
0
大牛,别默默的看了,快登录帮我点评一下吧!

立即注册