Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPIO init typo? #21

Open
tditwister opened this issue Mar 27, 2022 · 2 comments
Open

GPIO init typo? #21

tditwister opened this issue Mar 27, 2022 · 2 comments

Comments

@tditwister
Copy link

I'm new to this but shouldn't this be TempSensor instead of TS?

@jaybee79
Copy link

jaybee79 commented Apr 22, 2022

I agree with you, TS is intended to contain the temperature (as float value). The correct pin numer is set there:

#define TempSensor 35 //SYSTEM PARAMETER - Temperature Sensor GPIO Pin

As GPIOs on microcontrollers are normally acting as input input at boot-time/after reset and the GPIO 0 pin is only used as input in this firmare there is nothing that could be damaged.
Anyway: that's a minor failure that should be corrected.

@cyberangel22k
Copy link

cyberangel22k commented Jul 22, 2023

  if(sampleStoreTS<=avgCountTS){                               //TEMPERATURE SENSOR - Lite Averaging
    TS = TS + analogRead(TempSensor);
    sampleStoreTS++;   
  }
  else{
    TS = TS/sampleStoreTS;
    TSlog = log(ntcResistance*(4095.00/TS-1.00));
    temperature = (1.0/(1.009249522e-03+2.378405444e-04*TSlog+2.019202697e-07*TSlog*TSlog*TSlog))-273.15;
    sampleStoreTS = 0;
    TS = 0;
  }

I think the sketch is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants