Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. delay(400);
  2. sensorValue = analogRead(A0);
  3. Serial.print("sensor Value: ");
  4. Serial.print(sensorValue);
  5. // convert the ADC reading to voltage
  6. float voltage = (sensorValue/1023.0) * 5.0;
  7. float resistance = ((4700 * voltage) / (5 - voltage));
  8. Serial.print(", Resistance: ");
  9. Serial.println(resistance);
  10. // Send the voltage level out the Serial port
  11. Serial.print(", Volts: ");
  12. Serial.print(voltage);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement