arduino uno 的analogRead()是怎样读取模拟值的
floatwendu;floatindex;floattemp;voidsetup(){//putyoursetupcodehere,torunonce:Serial.b...
float wendu;
float index;
float temp;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(A5,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
temp=analogRead(A5);
index=(temp*5)/10;
wendu=index;
Serial.println(wendu);
delay(1500);
}为什么temp要*5/10呢 展开
float index;
float temp;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(A5,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
temp=analogRead(A5);
index=(temp*5)/10;
wendu=index;
Serial.println(wendu);
delay(1500);
}为什么temp要*5/10呢 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询