1 Reply Latest reply on Aug 28, 2017 1:27 PM by Intel Corporation

    Intel Curie i2c speed - Help needed

    KimLorentz

      I got an arduino 101 and are trying to use an AM2315 on it.

      But I dont get any data.

      It looks like the i2c speed is wrong? Have anyone got the AM2315 to work on the Intel Curie chip?

       

      Here is my test code.

      #include <Wire.h>
      #define AM2315_I2CADDR       0x5C
      #define AM2315_READREG       0x03
      uint8_t reply[10];
      
      void setup() {
        Serial.begin(9600);
        Wire.begin();
      
      }
      
      void loop() {
        
      // Wake up the sensor
        Wire.beginTransmission(AM2315_I2CADDR);
        delay(2);
        Wire.endTransmission();
      
      // OK lets ready!
        Wire.beginTransmission(AM2315_I2CADDR);
        Wire.write(AM2315_READREG);
        Wire.write(0x00);  // start at address 0x0
        Wire.write(4);  // request 4 bytes data
        Wire.endTransmission();
        
        delay(10); // add delay between request and actual read!
      
        Wire.requestFrom(AM2315_I2CADDR, 8);
        for (uint8_t i=0; i<8; i++) {
          reply[i] = Wire.read();
          Serial.println(reply[i], HEX);
        }
      
        delay(2000);
      }
      

       

      The code Works fine on the Arduino Mega 2560.

      Tryed using "Wire.setClock(400000L);" but did not help