MistyGro API
C++ API for MistyGro's ESP32 controller based on the Arduino framework
Public Member Functions | List of all members
LDR Class Reference

Light dependent resistor wrapper. More...

#include <ldr.h>

Public Member Functions

 LDR (int samples, ADC *adc)
 Construct a new LDR object. More...
 
float read_voltage ()
 Read voltage from ADC for LDR. Make sure ADC is initialised before calling this method. More...
 

Detailed Description

Light dependent resistor wrapper.

Definition at line 28 of file ldr.h.

Constructor & Destructor Documentation

◆ LDR()

LDR::LDR ( int  samples,
ADC adc 
)

Construct a new LDR object.

Parameters
samplestotal samples to use for voltage calculation (uses median to compute final value)
adcThe adc to use to read samples

Definition at line 19 of file ldr.cpp.

Member Function Documentation

◆ read_voltage()

float LDR::read_voltage ( )

Read voltage from ADC for LDR. Make sure ADC is initialised before calling this method.

Returns
float LDR voltage at junction

Definition at line 21 of file ldr.cpp.


The documentation for this class was generated from the following files: