Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. float V;
  2. float V_T;
  3.  
  4. void setup() {
  5. Serial.begin(9600);
  6. }
  7.  
  8. void loop() {
  9. analogReference(INTERNAL);
  10. //analogReference(DEFAULT);
  11. V=analogRead(A5);
  12. V_T=V*1.1/10/100*3; //analogRead dà valori da 0 a 1023, lo abbiamo quindi mappato in una tensione usando il riferimento interno di 1.1V dell'Arduino
  13. Serial.println(V_T*10); //T=V_T*50/5 (50 = T_max, 5 = V_max)
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement