Code-Basis für Programm zum Taster-Entprellen

Dependencies:   SB1602E mbed

Fork of Laser-Distance by Stefan Kummer

Committer:
andcor02
Date:
Thu Nov 02 10:05:00 2017 +0000
Revision:
2:587b4d7444d1
Parent:
1:76a5fa924120
Child:
3:1ed9495c9158
Sets up LCD and prints sensor data value of CCS811 Indoor Air Quality sensor to LCD

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andcor02 0:80032665d37e 1 #include "mbed.h"
andcor02 0:80032665d37e 2 #include "C12832.h"
andcor02 0:80032665d37e 3 #include "CCS811.h"
andcor02 0:80032665d37e 4
andcor02 0:80032665d37e 5 /* Sets up LCD and prints sensor data value of Indoor Air Quality sensor to LCD */
andcor02 0:80032665d37e 6
andcor02 0:80032665d37e 7 C12832 lcd(PE_14, PE_12, PD_12, PD_11, PE_9); //LCD: MOSI, SCK, RESET, A0, nCS
andcor02 0:80032665d37e 8 CCS811 ccs811(PF_0, PF_1); //IAQ SENSOR: I2C_SDA, I2C_SCL
andcor02 0:80032665d37e 9
andcor02 0:80032665d37e 10 int main()
andcor02 0:80032665d37e 11 {
andcor02 0:80032665d37e 12 ccs811.init();
andcor02 0:80032665d37e 13
andcor02 0:80032665d37e 14 while(1) {
andcor02 0:80032665d37e 15 uint16_t eco2, tvoc;
andcor02 0:80032665d37e 16 ccs811.readData(&eco2, &tvoc);
andcor02 0:80032665d37e 17
andcor02 0:80032665d37e 18 lcd.locate(0,3);
andcor02 0:80032665d37e 19 lcd.printf("[AIR QUAL]");
andcor02 0:80032665d37e 20 lcd.locate(0,15);
andcor02 0:80032665d37e 21 lcd.printf("eCO2:%dppm, TVO:%dppb", eco2, tvoc); // Print to LCD values
andcor02 1:76a5fa924120 22 wait(1);
andcor02 1:76a5fa924120 23 lcd.cls();
andcor02 0:80032665d37e 24 }
andcor02 2:587b4d7444d1 25 }