Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. void loop(){
  2. CurrentVoltage = analogRead(analogInput);
  3. if(fabs(CurrentVoltage - PreviousVoltage) < 5 ) CurrentVoltage=PreviousVoltage;
  4. vout = (CurrentVoltage * 5.0) / 1024.0;
  5. vin = vout / (R2/(R1+R2));
  6. lcd.setCursor(0, 1);
  7. lcd.print("INPUT V= ");
  8. lcd.print(vin,3);
  9. delay(1000);
  10. PreviousVoltage = CurrentVoltage;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement