ud_servo.write(ud_angle); //output the angle of servo
delay(m_speed);
}
else if (abs(U - D) <= error) { //Determine whether the error is within
the acceptable range. If it is, keep it stable and make no change in
angle
// ud_servo.detach(); //release the pin of servo
ud_servo.write(ud_angle); //output the angle of servo
}
}
void LcdShowValue() {
char str1[5];
char str2[2];
char str3[2];
dtostrf(light, -5, 0, str1); //Format the light value data as a string,
left-aligned
dtostrf(temperature, -2, 0, str2);
dtostrf(humidity, -2, 0, str3);
//LCD1602 display
//display the value of the light intensity