5 Replies Latest reply on Aug 6, 2014 9:57 AM by jjaken

    Intel Galileo OneWire and Dallas Temperature Arduino Code not working

    aodhgan

      Hello,

       

      I was developing a project which includes reading temperature sensor values from DS18B20 sensors. This code works on the Arduino Mega2560 but not on the Intel Galileo. The galileo gives default non-working value of -127 and blinks the LED much slower than it should - 15 to 20 seconds. The latest release notes say that the OneWire and Dallas temeprature libraries both work with the latest release of galileo firmware. Can somebody please advise me as to what is going wrong:

       

      #include <OneWire.h>

      #include <DallasTemperature.h>

       

      #define ONE_WIRE_BUS_PIN 7

       

      OneWire oneWire(ONE_WIRE_BUS_PIN);

      DallasTemperature sensors(&oneWire);

       

       

      int led = 9;

       

       

      DeviceAddress Probe6= {0x28, 0x64, 0x0D, 0x98, 0x05, 0x00, 0x00, 0x25};

      DeviceAddress Probe8 = {0x28, 0x32, 0x98, 0x98, 0x05, 0x00, 0x00, 0xDC};

       

       

      int temp6=0;

      int temp8=0;

       

      // the setup routine runs once when you press reset:

      void setup() {

       

      Serial.begin(9600);

      Serial.println("Intialised");

      sensors.begin();

      sensors.setResolution(Probe6, 8);

        sensors.setResolution(Probe8, 8);

       

       

       

        // initialize the digital pin as an output.

        pinMode(led, OUTPUT);    

      }

       

       

      // the loop routine runs over and over again forever:

      void loop() {

        digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)

        delay(1000);               // wait for a second

        digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW

        delay(1000);               // wait for a second

       

       

      sensors.requestTemperatures();

       

       

      temp6= sensors.getTempC(Probe6);

      temp8=sensors.getTempC(Probe8);

      Serial.println("Temp sensor 6");

      Serial.println(temp6);

      Serial.println("Temp sensor 8");

      Serial.println(temp8);

       

       

       

      }