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

Dependencies:   RF24 USBDevice mbed

Sensors/Photoresistor.h

Committer:
pro100kot14
Date:
2015-12-05
Revision:
6:db4538895ae7
Parent:
4:7cd67d988145

File content as of revision 6:db4538895ae7:

#ifndef PHOTORESISTOR_H
#define PHOTORESISTOR_H

#include "mbed.h"
#include "Illumination.h"
/**
* Reads the resistance of photoresistor and associates it with 
* the light level of illumination provided by enum Illumination.
*/
class Photoresistor{  
public:
    /**
    * Constructor
    *
    * @param inputChanel The analog input is connected to the photoresistor
    */
    Photoresistor(AnalogIn inputChanel);
    
    /**
    * Level of illumination provided by enum Illumination
    *
    * @returns Level of illumination
    */
    Illumination getIllumination();

    /**
    * Level of illumination provided by enum Illumination.
    * Сomfortably for testing.
    *
    * @param adcVal ADC value on the port to which the sensor is connected
    *
    * @returns Level of illumination
    */
    static Illumination getIlluminationByAdcValue(float adcVal);
    
private:
    AnalogIn input;
};

/**
* Tested the class Photoresistor
*/
class PhotoresistorTest{
public:
    static bool adcValue_0_isDark();
    static bool adcValue_0_009_isDark();
    static bool adcValue_0_34_isVeryCloudly();
    static bool adcValue_0_93_isCloudly();
    static bool adcValue_0_97_isClear();
    static bool adcValue_0_98_isVerySunny();
};

#endif