Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 00003 SPI spi(P0_28, P0_24, P0_29); // mosi, miso, sclk 00004 DigitalOut cs(P0_25); //bar1 00005 00006 00007 // ACC Registers 00008 #define BMP280_ID 0xD0 00009 #define BMP280_READ_FLAG 0x80 00010 00011 //Test that spi is working with fram BMP280 memory 00012 //mosi: || 0xD0 0x00 || 00013 //miso: || 0x00 0x58 || 00014 00015 int main() { 00016 cs=1; 00017 while(1) { 00018 cs=0; 00019 spi.write(BMP280_ID| BMP280_READ_FLAG); 00020 uint8_t val = spi.write(0x00); 00021 cs=1; 00022 wait(0.5); 00023 } 00024 } 00025
Generated on Mon Jul 18 2022 21:20:14 by
1.7.2