Skip to content

Instantly share code, notes, and snippets.

@ugeugeHigh
Created September 5, 2018 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ugeugeHigh/b6142e8ada762cfa6419dc6c6846ea46 to your computer and use it in GitHub Desktop.
Save ugeugeHigh/b6142e8ada762cfa6419dc6c6846ea46 to your computer and use it in GitHub Desktop.
const float R1 = 51;
void setup() {
Serial.begin(9600);
}
void loop() {
float val,v,R,T;
val = analogRead(A5);
v = 5*val/1024;
R = v*R1/(5-v);
float y = 0.000000000013787144257*pow(R,6) - 0.000000009644367069195*pow(R,5) + 0.00000277186613462706*pow(R,4) - 0.000424985505891903*pow(R,3) + 0.0381152369481333*pow(R,2) - 2.1624066385036*R + 76.3990502088956;
Serial.println(y);
delay(1000);
}
@ugeugeHigh
Copy link
Author

This is a sketch of Arduino.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment