mbed-os github

Dependencies:   ADS1015 Faulhaber HTU21D_mod MS5837_potless Sensor_Head_RevB_3 USBDevice_dfu Utilsdfu beep

Fork of ARNSRS_testDFU by POTLESS

main.cpp

Committer:
potless
Date:
2017-04-29
Revision:
0:69d4b21d58e0
Child:
1:bef7856b5c0a

File content as of revision 0:69d4b21d58e0:

#include "mbed.h"

Serial serialCozir (PA_9,PA_10,9600);
Serial serialMonit (USBTX,USBRX,9600);
int co2=0;
char buffer[6];



    


int requestCO2() {
    int result = 0;
    int i;
    // demander les ppm de CO2 au capteur (Z majuscule lire notice) en mode pooling    
    
    serialCozir.printf("Z\r\n");
    while (serialCozir.getc() != 'Z' ) { // on attend la réponse en Z majuscule
         }
         
    for (i=1;i<6;i++){
        buffer[i]=serialCozir.getc();
        }
      buffer[i] = '\0';
      atoi(&buffer[6]);  
    return result;
}


int main(){
    serialMonit.printf("co2 = %d\r\n",requestCO2);
    wait (1);
    
    }