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

Dependencies:   RF24 USBDevice mbed

main.cpp

Committer:
pro100kot14
Date:
2015-12-05
Revision:
6:db4538895ae7
Parent:
3:346b49152f1e

File content as of revision 6:db4538895ae7:

#include "WirelessListener.h"

#define TEST

#ifdef TEST
#include "USBSerial.h"
DigitalOut ledD1(LED1);
DigitalOut ledD2(LED2);
DigitalOut ledD3(LED3);
DigitalOut ledD4(LED4);

void doTest(){
    ledD1 = ledD2 = ledD3 = ledD4 = 0;
    if(
        ThermometerTmp36Test::adcValue_0_15_is_0_degree() &&
        ThermometerTmp36Test::adcValue_0_196_is_15_degree() &&
        ThermometerTmp36Test::adcValue_0_242_is_30_degree()
    ) ledD1 = 1;
        
    if(
        ThermistorTest::adcValue_0_049_is_0_degree() &&
        ThermistorTest::adcValue_0_104_is_15_degree() && 
        ThermistorTest::adcValue_0_202_is_30_degree()
    ) ledD2 = 1;
    
    if(
        PhotoresistorTest::adcValue_0_isDark() &&
        PhotoresistorTest::adcValue_0_009_isDark() &&
        PhotoresistorTest::adcValue_0_34_isVeryCloudly() &&
        PhotoresistorTest::adcValue_0_93_isCloudly() &&
        PhotoresistorTest::adcValue_0_97_isClear() &&
        PhotoresistorTest::adcValue_0_98_isVerySunny()
    ) ledD3 = 1;
}
#endif

int main(){
    #ifdef TEST
    doTest();
    #endif
    
    WirelessListener listener(0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL);
    
    listener.startListening();
    
    return 0;    
}