Toyomasa Watarai
/
BME280_SPI_Hello
Hello program for BME280_SPI library
Fork of BME280_Hello by
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "BME280_SPI.h" 00003 00004 Serial pc(USBTX, USBRX); 00005 #if defined(TARGET_LPC1768) 00006 BME280_SPI sensor(p5, p6, p7, p8); // mosi, miso, sclk, cs 00007 #elif defined(TARGET_NUCLEO_F401RE) 00008 BME280_SPI sensor(D4, D5, D3, D7); // mosi, miso, sclk, cs 00009 #endif 00010 00011 int main() { 00012 00013 while(1) { 00014 pc.printf("%2.2f degC, %04.2f hPa, %2.2f %%\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity()); 00015 wait(1); 00016 } 00017 }
Generated on Thu Jul 14 2022 02:11:29 by 1.7.2