Loom 4 v4.5
Arduino library for Internet of Things Rapid Prototyping in environmental sensing
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Loom_Analog Class Reference

#include <Loom_Analog.h>

Inheritance diagram for Loom_Analog:
Inheritance graph
[legend]
Collaboration diagram for Loom_Analog:
Collaboration graph
[legend]

Public Member Functions

void measure () override
 
void package () override
 
template<typename T , typename... Args>
 Loom_Analog (Manager &man, T firstPin, Args... additionalPins)
 
template<typename T >
 Loom_Analog (Manager &man, T firstPin)
 
 Loom_Analog (Manager &man)
 
float getBatteryVoltage ()
 
float getMV (int pin)
 
float getAnalog (int pin)
 
- Public Member Functions inherited from Module
 Module (const char *modName)
 
void setModuleName (const char *modName)
 
virtual const char * getModuleName ()
 
virtual void printModuleName (const char *message)
 
virtual void initialize ()=0
 
virtual void measure ()=0
 
virtual void package ()=0
 
virtual void power_up ()=0
 
virtual void power_down ()=0
 
virtual void display_data ()
 

Protected Member Functions

void power_up () override
 
void power_down () override
 
void initialize () override
 

Additional Inherited Members

- Public Attributes inherited from Module
bool moduleInitialized = true
 
int module_address = -1
 

Detailed Description

Used to read Analog voltages from the analog pins on the feather M0

Author
Will Richards

Constructor & Destructor Documentation

◆ Loom_Analog() [1/3]

template<typename T , typename... Args>
Loom_Analog::Loom_Analog ( Manager man,
firstPin,
Args...  additionalPins 
)
inline

Templated constructor that uses more than 1 analog pin

Parameters
manReference to the manager
firstPinFirst analog pin we want to read from
additionalPinsVariable length argument allowing you to supply multiple pins

◆ Loom_Analog() [2/3]

template<typename T >
Loom_Analog::Loom_Analog ( Manager man,
firstPin 
)
inline

Templated constructor that uses only 1 analog pin

Parameters
manReference to the manager
firstPinFirst analog pin we want to read from

◆ Loom_Analog() [3/3]

Loom_Analog::Loom_Analog ( Manager man)
inline

Templated constructor that only reads the battery voltage

Parameters
manReference to the manager

Member Function Documentation

◆ getAnalog()

float Loom_Analog::getAnalog ( int  pin)

Get the analog value from a given pin

Parameters
pinThe pin to get the data from eg. A0, A1, ...

◆ getBatteryVoltage()

float Loom_Analog::getBatteryVoltage ( )

Get the current voltage of the battery

◆ getMV()

float Loom_Analog::getMV ( int  pin)

Get the Millivolts of a specified pin

Parameters
pinThe pin to get the data from eg. A0, A1, ...

◆ initialize()

void Loom_Analog::initialize ( )
inlineoverrideprotectedvirtual

Implements Module.

◆ measure()

void Loom_Analog::measure ( )
overridevirtual

Implements Module.

◆ package()

void Loom_Analog::package ( )
overridevirtual

Implements Module.

◆ power_down()

void Loom_Analog::power_down ( )
inlineoverrideprotectedvirtual

Implements Module.

◆ power_up()

void Loom_Analog::power_up ( )
inlineoverrideprotectedvirtual

Implements Module.


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