Сбор информации о погодных условиях

Dependencies:   RF24 USBDevice mbed

main.cpp

Committer:
pro100kot14
Date:
2015-10-22
Revision:
2:ad2653bcf93f
Parent:
1:8766173d267f
Child:
3:346b49152f1e

File content as of revision 2:ad2653bcf93f:

#include "mbed.h"
#include "USBSerial.h"
#include "ThermometerTmp36.h"
#include "Thermistor.h"
#include "Photoresistor.h"

USBSerial pc;
AnalogIn   tmp36(A0);
AnalogIn   thermist(A2);
AnalogIn   photoresist(A4);
char lightLevels[][12]={
    "Dark", 
    "Very cloudy",
    "Cloudy", 
    "Clear", 
    "Very sunny"
    };
int main() {
    ThermometerTmp36 termTmp36(tmp36);
    Thermistor term503(thermist, 0.001995, 0.00007997, 0.0000003863);
    Photoresistor light(photoresist);
    term503.setError(-5000);
    while(1) {
        pc.printf("TMP36: %f degC\tTermistor: %f degC\t%s\r\n", termTmp36.getTemperature(), term503.getTemperature(), lightLevels[light.getIllumination()]);
        wait(1);
    }
}