Skip to content

Commit

Permalink
Example Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianrau committed Jul 28, 2017
1 parent 3584b5f commit a5df455
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
20 changes: 7 additions & 13 deletions examples/ntc100k_calculation/ntc100k_calculation.ino
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@

#include <PTCcalc.h>
#include <RTDcalc.h>


double mesurredResistance0 = 109.73, // 25 degree celsius
mesurredResistance1 = 1077.94; // 20 degree celsius
double mesurredResistance0 = 100000; // 25 degree celsius


RTDcalc ptcCalc0, //Set as default: PT100
ptcCalc1(R0_PT100); //Set explicit as PT100
RTDcalc ptcCalc0(100000,4850); //Set NTC with 100000Ohm @ 25 Deg. Celsius and B=4850


double temperature0,
temperature1;
double temperature0;


void setup ( void ) {
Serial.begin(115200);


ptcCalc1.setR0(R0_PT1000); //Use constructor or this set Method.

temperature0 = ptcCalc0.calcPTC_Celsius(mesurredResistance0);
temperature1 = ptcCalc1.calcPTC_Celsius(mesurredResistance1);


Serial.print("T0:\t");
Serial.print(temperature0);
Serial.println(" deg. celsius. (should be ~25)");
Serial.print("T1:\t");
Serial.print(temperature1);
Serial.println(" deg. celsius. (should be ~20)");
}

void loop ( void ) {
Expand Down
4 changes: 2 additions & 2 deletions examples/pt100_calculation/pt100_calculation.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include <PTCcalc.h>
#include <RTDcalc.h>


double mesurredResistance0 = 109.73, // 25 degree celsius
Expand All @@ -16,7 +16,7 @@ void setup ( void ) {
Serial.begin(115200);


ptcCalc1.setR0(R0_PT1000); //Use constructor or this set Method.
ptcCalc1.setR0(R0_PT1000); //Use constructor or this set Method to set R0.

temperature0 = ptcCalc0.calcTemperatureCelsius(mesurredResistance0);
temperature1 = ptcCalc1.calcTemperatureCelsius(mesurredResistance1);
Expand Down

0 comments on commit a5df455

Please sign in to comment.