Advertisement
Guest User

Untitled

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