Closed rohitsam closed 3 years ago
In the cyanobyte datasheet Many registers are given wrong datasize #246
uint16_t BMP280::readDigP8() {
uint8_t datum;
uint16_t value;
_wire->beginTransmission(DEVICE_ADDRESS);
_wire->write(REGISTER_DIGP8);
if (_wire->endTransmission(false) != 0) {
return -1;
}
if (_wire->requestFrom(DEVICE_ADDRESS, 2) != 2) {
return 0;
}
datum = _wire->read();
value = value << 8 | datum;
datum = _wire->read();
value = value << 8 | datum;
return value;
}
This is the generated code of BMP280 for arduino, and the endianness is ignored.
Yeah I'll need to re-review the datasheet and ensure that the registers are all correctly typed.
The template for Arduino doesn't have method to typecast variables.
Arduino variables should now be properly signed as-necessary.
Hey,
I have run cyanobyte-Codegen for Sensor BMP280 and generated code for Arduino.
Later I have used these generated library files and written these lines of code for Atmega 328(Arduino)
But I get null output. I have also confirmed my my hardware to be working fine, since I have verifyed it with adfruits library