Skip to content

Instantly share code, notes, and snippets.

@dedeweb
Created November 13, 2020 15:28
Show Gist options
  • Save dedeweb/99735e69d4bb2a67ca25efe3041f003e to your computer and use it in GitHub Desktop.
Save dedeweb/99735e69d4bb2a67ca25efe3041f003e to your computer and use it in GitHub Desktop.
import 'dart:math';
void main() {
var adcRaw = 3120;
var rawValue = (adcRaw * 3.2) / 4096;
var rT = (3.2 * 60400) / (3.2 - rawValue) - 60400;
var tempKelv = 4250 * 298 / (4250 + 298 * (log(rT / 1000) - log(100)));
var degC = tempKelv - 273.15; //to deg celciuss
var correctDegC = (degC -2.2007)/0.907;
print(correctDegC);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment