![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Base test for BMP sensor
main.cpp
- Committer:
- smigielski
- Date:
- 2015-01-31
- Revision:
- 2:6c3a80f22a6c
- Parent:
- 1:74258861ec91
File content as of revision 2:6c3a80f22a6c:
#include "mbed.h" SPI spi(P0_28, P0_24, P0_29); // mosi, miso, sclk DigitalOut cs(P0_25); //bar1 // ACC Registers #define BMP280_ID 0xD0 #define BMP280_READ_FLAG 0x80 //Test that spi is working with fram BMP280 memory //mosi: || 0xD0 0x00 || //miso: || 0x00 0x58 || int main() { cs=1; while(1) { cs=0; spi.write(BMP280_ID| BMP280_READ_FLAG); uint8_t val = spi.write(0x00); cs=1; wait(0.5); } }