SGP30 (used in POCBreath_V2_smd_commercial)

Dependencies:   Adafruit_SGP30_mbed mbed

Committer:
christodoulos
Date:
Fri May 01 14:32:18 2020 +0000
Revision:
5:2d4c7a0d805d
Parent:
3:3d51f8870e91
SGP30 (used in POCBreath_V2_smd_commercial)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
christodoulos 0:d034cdad5b6d 1 #include "mbed.h"
christodoulos 5:2d4c7a0d805d 2 #include "Adafruit_SGP30.h"
christodoulos 0:d034cdad5b6d 3
christodoulos 5:2d4c7a0d805d 4 Serial ble(PC_12,PD_2);
christodoulos 5:2d4c7a0d805d 5 Adafruit_SGP30 sgp30(PB_14,PB_13);
mehrnaz 2:ef98576cd67b 6
mehrnaz 2:ef98576cd67b 7 int main()
christodoulos 0:d034cdad5b6d 8 {
christodoulos 5:2d4c7a0d805d 9 ble.baud(9600);
christodoulos 5:2d4c7a0d805d 10 sgp30.begin();
christodoulos 5:2d4c7a0d805d 11 // uint16_t *TVOC;
christodoulos 5:2d4c7a0d805d 12 // uint16_t *eCO2;
christodoulos 5:2d4c7a0d805d 13 sgp30.IAQinit();
mehrnaz 3:3d51f8870e91 14
christodoulos 5:2d4c7a0d805d 15 while(1){
christodoulos 5:2d4c7a0d805d 16 sgp30.IAQmeasure();
christodoulos 5:2d4c7a0d805d 17 wait(0.1);
christodoulos 5:2d4c7a0d805d 18 ble.printf("eco2: %dppm, tvoc: %dppb\n",sgp30.eCO2,sgp30.TVOC);
christodoulos 5:2d4c7a0d805d 19 wait(0.1);
christodoulos 5:2d4c7a0d805d 20 }
mehrnaz 3:3d51f8870e91 21
mehrnaz 2:ef98576cd67b 22 }