Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void loop(){
- CurrentVoltage = analogRead(analogInput);
- if(fabs(CurrentVoltage - PreviousVoltage) < 5 ) {
- CurrentVoltage=PreviousVoltage;
- }
- vout = (CurrentVoltage * 5.0) / 1024.0;
- vin = vout / (R2/(R1+R2));
- lcd.setCursor(0, 1);
- lcd.print("INPUT V= ");
- lcd.print(vin,3);
- delay(1000);
- PreviousVoltage = CurrentVoltage;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement