Base test for BMP sensor
Dependencies: mbed
Fork of BMP280_test by
Diff: main.cpp
- Revision:
- 0:de1b4253519e
- Child:
- 1:74258861ec91
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Jan 31 19:56:09 2015 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" + +SPI spi(P0_28, P0_24, P0_29); // mosi, miso, sclk +DigitalOut cs(P0_25); + + +// ACC Registers +#define BMP280_ID 0xD0 +#define BMP280_READ_FLAG 0x80 + +//Test that spi is working with fram FM25CL memory +//mosi: || 0xD0 0x00 || +//miso: || 0x00 0x58 || + +//Test that spi is working with fram W25Q256 memory +int main() { + cs=1; + while(1) { + cs=0; + spi.write(BMP280_ID| BMP280_READ_FLAG); + uint8_t val = spi.write(0x00); + //Device id is 0x71 + cs=1; + wait(0.5); + } +} +