Hi all,
Long time lurker but first time poster here (be gentle ). I am trying to interface my Teensy with a Sensirion Pressure Sensor SDP810 (datasheet at: http://www.mouser.com/ds/2/682/Sensirion_01102017_1-101551-01-1079500.pdf ).
I have wired it up to my Teensy 3.2 as expected, using 4.7k Ohms for pull up resistors. This is where the issues start. My code is DOA. There is nothing on the Serial Monitor. It compiles, uploads and then, nothing. Thinking it may be due to the wiring, I used the nifty I2C Scanner code from the Arduino website to see if the sensor is indeed being recognised. It was, at the same address as mentioned in the above datasheet (0x25).
I have combed through some other threads on getting I2C to work, but to no avail. If anyone can point me in the right direction, I would be most obliged. Thanks!
Long time lurker but first time poster here (be gentle ). I am trying to interface my Teensy with a Sensirion Pressure Sensor SDP810 (datasheet at: http://www.mouser.com/ds/2/682/Sensirion_01102017_1-101551-01-1079500.pdf ).
I have wired it up to my Teensy 3.2 as expected, using 4.7k Ohms for pull up resistors. This is where the issues start. My code is DOA. There is nothing on the Serial Monitor. It compiles, uploads and then, nothing. Thinking it may be due to the wiring, I used the nifty I2C Scanner code from the Arduino website to see if the sensor is indeed being recognised. It was, at the same address as mentioned in the above datasheet (0x25).
I have combed through some other threads on getting I2C to work, but to no avail. If anyone can point me in the right direction, I would be most obliged. Thanks!
Code:
#include "Wire.h"
void setup() {
Wire.begin();
Serial.begin(9600);
}
void loop() {
byte lobyte;
byte hibyte;
Wire.beginTransmission(0x25); //address of the SDP sensor
Wire.write(0x361E); //command to request data from the sensor, on page 7 of the datasheet
Wire.endTransmission();
Wire.requestFrom(0x25, 2); // contents of your first two registers as they have the differential pressure data, page 7
while(Wire.available() < 2 ); // check when there is data
{
delay(100);
lobyte = Wire.read(); // read msb
Serial.println(lobyte, DEC);
hibyte = Wire.read(); // read lsb
Serial.println(hibyte, DEC);
delay(100);
}
}