#include <Servo.h> Servo myservo;//Steering engine int p = 8;//数字针角 int a = 0;//模拟量输出 long lm35value = 0; float lm35float = 0; void setup() { myservo.attach(p); Serial.begin(9600);//set baud rate } void loop() { lm35value = analogRead(a);//get lm35 //lm35float = (lm35value*0.0048828125*100); lm35float = (125 * lm35value) >> 8; Serial.println(lm35float); delay(2000); }
v5+a0+p8