const int red_led=4; const int yellow_led=2; const int gr_led=3; int tep=0; float potPin=0; long val=0;
void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(red_led,OUTPUT); pinMode(yellow_led,OUTPUT); pinMode(gr_led,OUTPUT);
}
void loop() { // put your main code here, to run repeatedly:
永远不要期待对等,任何人和事
看了我系了7年的腰带,我想起7年前,18岁,觉得自己有无限可能,有一肚子话要说,想让这个世界听听自己的意见。现在我只是换根腰带,还有班要上,还有骂要挨,还有亲要相,人生的可能性消失殆尽,像是发起了一场冲锋,却没有找到敌人,无疾而终。我扑空了!
百年孤独
离成熟还差很多
半夜情绪拉扯真的幼稚
爱好仅仅适合与有同等爱好的人分享
太阳拜拜
美好的一天从乐跑服务器崩了开始
const int red_led=4;
const int yellow_led=2;
const int gr_led=3;
int tep=0;
float potPin=0;
long val=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(red_led,OUTPUT);
pinMode(yellow_led,OUTPUT);
pinMode(gr_led,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
val=analogRead(potPin);
tep=(val0.0048828125100);
Serial.print("Tep= ");
Serial.print(tep);
Serial.println(" C");
delay(500);
if (tep>=20&&tep<=30)
{
digitalWrite(red_led,LOW);
digitalWrite(yellow_led,HIGH);
digitalWrite(gr_led,LOW);
}
else if (tep>30&&tep<=40)
{
digitalWrite(red_led,LOW);
digitalWrite(yellow_led,LOW);
digitalWrite(gr_led,HIGH);}
}
else (tep>40)
{
digitalWrite(red_led,HIGH);
digitalWrite(yellow_led,LOW);
digitalWrite(gr_led,LOW);
}
}
test1