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.
Dependencies: C12832 Sht31 vl53l0x_api
Fork of mbed-cloud-connect-sensor-accelerometer by
main.cpp
- Committer:
- andcor02
- Date:
- 2017-11-02
- Revision:
- 3:1ed9495c9158
- Parent:
- 2:587b4d7444d1
- Child:
- 4:ef7abafa9884
File content as of revision 3:1ed9495c9158:
#include "mbed.h" #include "C12832.h" #include "TSL2561.h" /* Sets up LCD and prints sensor data value of Indoor Air Quality sensor to LCD */ C12832 lcd(PE_14, PE_12, PD_12, PD_11, PE_9); //LCD: MOSI, SCK, RESET, A0, nCS TSL2561 tsl2561(PF_0, PF_1, TSL2561_ADDR_HIGH); //LIGHT SENSOR: I2C_SDA, I2C_SCL int main() { tsl2561.begin(); tsl2561.setGain(TSL2561_GAIN_0X); tsl2561.setTiming(TSL2561_INTEGRATIONTIME_402MS); while(1) { int x = tsl2561.getLuminosity(TSL2561_VISIBLE); int z = tsl2561.getLuminosity(TSL2561_INFRARED); lcd.cls(); lcd.locate(0,3); lcd.printf("[LIGHT]"); lcd.locate(0,14); lcd.printf("VIS: %d, INFR: %d ",x, z); wait(1); // Print to LCD values } }