Saltware / Mbed 2 deprecated Water Play

Dependencies:   mbed DRV88255 TextLCD Ping mbed-rtos

Embed: (wiki syntax)

« Back to documentation index

TemperatureController Class Reference

TemperatureController Class Reference

The TemperatureController measures the Vernier temperature probe. More...

#include <TemperatureController.h>

Inherits SensorController.

Public Member Functions

 TemperatureController (bool threaded, int interval_ms)
 Constructs a new TemperatureController that measures and averages the value from the temperature probe.
virtual float getValue ()
 Returns the Temperature measured (in Celsius) during the last update()
virtual void update ()
 Measures the Temperature N times and stores the average value of these measurements.
virtual std::string getName ()
 Returns "TemperatureController".
bool isThreaded ()
 Returns whether or not this Controller is being threaded.
void run ()
 If this Controller is not threaded, update() is called.
int getIntervalMs ()
 Returns the interval between each iteration if threaded.
void setPriority (osPriority priority)
 Sets the underlying RTOS thread priority.
osPriority getPriority ()
 Returns the thread priority.

Protected Attributes

unsigned long num_iters
 The number of times run() is called.

Detailed Description

The TemperatureController measures the Vernier temperature probe.

Definition at line 11 of file TemperatureController.h.


Constructor & Destructor Documentation

TemperatureController ( bool  threaded,
int  interval_ms 
)

Constructs a new TemperatureController that measures and averages the value from the temperature probe.

Parameters:
threadedwhether or not the controller should be threaded.
interval_msdelay between each iteration, only if threaded is set to true.

Definition at line 18 of file TemperatureController.h.


Member Function Documentation

int getIntervalMs (  ) [inherited]

Returns the interval between each iteration if threaded.

Returns:
interval_ms as specified in the constructor.

Definition at line 29 of file Controller.cpp.

std::string getName (  ) [virtual]

Returns "TemperatureController".

Implements Controller.

Definition at line 10 of file TemperatureController.cpp.

osPriority getPriority (  ) [inherited]

Returns the thread priority.

Returns:
the thread priority.

Definition at line 39 of file Controller.cpp.

float getValue (  ) [virtual]

Returns the Temperature measured (in Celsius) during the last update()

Definition at line 6 of file TemperatureController.cpp.

bool isThreaded (  ) [inherited]

Returns whether or not this Controller is being threaded.

Returns:
true if this Controller is being threaded, false otherwise.

Definition at line 13 of file Controller.cpp.

void run (  ) [inherited]

If this Controller is not threaded, update() is called.

Otherwise, the first time a thread is spawned which repeatedly calls update(). When the thread has already been spawned no action is taken.

Definition at line 17 of file Controller.cpp.

void setPriority ( osPriority  priority ) [inherited]

Sets the underlying RTOS thread priority.

See also:
cmis_os.h

Definition at line 33 of file Controller.cpp.

void update (  ) [virtual]

Measures the Temperature N times and stores the average value of these measurements.

Implements Controller.

Definition at line 14 of file TemperatureController.cpp.


Field Documentation

unsigned long num_iters [protected, inherited]

The number of times run() is called.

Definition at line 66 of file Controller.h.