Skip to content

Commit

Permalink
update example of TSD
Browse files Browse the repository at this point in the history
  • Loading branch information
PulseRainmaker committed Aug 26, 2017
1 parent cd8bab1 commit e2f99a0
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions examples/TSD/TSD.ino
Expand Up @@ -32,37 +32,34 @@ void setup() {
delay(1000);
Serial.begin(115200);
ADC.begin();
ADC.getCelsius();

} // End of setup()

void loop() {
uint16_t adc_value;

int16_t temp;

uint32_t sec;
uint32_t ms;

delay(1000);

temp = ADC.getCelsius();

ms = millis();
sec = ms / 1000;
ms -= sec * 1000;

adc_value = analogRead (ADC_TEMP_SENSOR_CHANNEL);
temp = ADC.getCelsius(adc_value);

//adc_value = analogRead (0);


Serial.write ("Time: ");
Serial.print (sec, DEC);
Serial.write (".");
Serial.print (ms, DEC);
Serial.write (" second, \tTemperature: ");
Serial.print(temp, DEC);
Serial.write (" Degree C (ADC=");
Serial.write (" Degree C ");

Serial.print (adc_value, DEC);
Serial.write(")\n\n");
Serial.write("\n\n");

} // End of loop()

0 comments on commit e2f99a0

Please sign in to comment.