Posted By

jatkins on 08/30/10


Tagged


Versions (?)

Temp Test


 / Published in: C
 

  1. #include <OneWire.h>
  2. #include <DallasTemperature.h>
  3.  
  4. OneWire firstSensor(8);
  5. OneWire secondSensor(10);
  6.  
  7. DallasTemperature sensorOne(&firstSensor);
  8. DallasTemperature sensorTwo(&secondSensor);
  9.  
  10. void setup() {
  11. Serial.begin(9600);
  12. }
  13.  
  14. void loop() {
  15. Serial.print("Temp #1: ");
  16. sensorOne.requestTemperatures();
  17. Serial.print(sensorOne.getTempCByIndex(0));
  18. Serial.print(" C -- Temp #2: ");
  19. sensorTwo.requestTemperatures();
  20. Serial.print(sensorTwo.getTempCByIndex(0));
  21. Serial.println(" C");
  22. }

Report this snippet  

You need to login to post a comment.