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.
Fork of 0NicksCoursework_copywithserialtime by
main.cpp
- Committer:
- noutram
- Date:
- 2017-09-13
- Revision:
- 0:36e89e3ed7c4
- Child:
- 1:e1cf7663f5ff
File content as of revision 0:36e89e3ed7c4:
#include "mbed.h"
#include "TextLCD.h"
//#define BME
#ifdef BME
#include "BME280.h"
#else
#include "BMP280.h"
#endif
//LCD Driver
//RS D9
//E D8
//D7,6,4,2 are the 4 bit for d4-7
TextLCD lcd(D9, D8, D7, D6, D4, D2); // rs, e, d4-d7
//Sensor driver
#ifdef BME
BME280 sensor(D14, D15);
#else
BMP280 sensor(D14, D15);
#endif
int main() {
while(1) {
double temp = sensor.getTemperature();
double pressure = sensor.getPressure();
lcd.printf("Temp Pressure\n");
lcd.printf("%6.1f ",temp);
lcd.printf("%.2f\n",pressure);
wait(2.0);
}
}
