Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void loop() {
//Read the pressure data lower 16 bits:
unsigned int pressure_data_low = readRegister(0x20, 2);
//combine the two parts into one 19-bit number:
long pressure = ((pressure_data_high << 16) | pressure_data_low)/4;
long pressure = (((long) pressure_data_high << 16) | pressure_data_low)/4;

// display the temperature:
Serial.println("\tPressure [Pa]=" + String(pressure));
Expand Down Expand Up @@ -150,4 +150,3 @@ void writeRegister(byte thisRegister, byte thisValue) {
// release control of the SPI port
SPI.endTransaction();
}