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
- Committer:
- 12104404
- Date:
- 2016-04-04
- Revision:
- 3:fecb1929cbef
- Parent:
- 2:dd10c541a3dc
File content as of revision 3:fecb1929cbef:
#include "mbed.h"
#include "TSL2591.h"
#include "BME280.h"
I2C i2c1(I2C_SDA, I2C_SCL);
BME280 sensor(i2c1, BME280_ADDR_L);
TSL2591 sensor1(i2c1, TSL2591_ADDR);
int main()
{
sensor.init();
while(1) {
sensor1.getALS();
sensor1.calcLux();
printf("%d \t %d \t %d \t %d\n",sensor1.full,sensor1.ir,(int16_t)sensor1.visible,sensor1.lux);
printf("%2.2f degC, %04.2f hPa, %2.2f %%\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity());
wait(1);
}
}