Apps     Components     Interfaces     All Files     Source Tree     source: apps.SenseTask.SenseTaskM.nc

Component: SenseTaskM

Implementation for SenseTask application. When the timer fires, this application reads sensor data, posts a task that averages the sensor readings, and displays the highest 3 bits of the average to the LEDs.
Author: David Culler
  Su Ping
  Intel Research Berkeley Lab

Required Interfaces

Provided Interfaces

Variables

Function Index

Function Descriptions

putdata

__inline void putdata(int16_t val)

Module scoped method. Save sensor data into circular buffer.
Returns: returns void

display

result_t display(uint16_t value)

Module scoped method. Displays the lowest 3 bits to the LEDs, with RED being the most signficant and YELLOW being the least significant.
Returns: returns SUCCESS

processData

task void processData(void)

Module task. Process sensor reading, compute the average, and display it.
Returns: returns void

StdControl.init

command result_t StdControl.init (void)

Initialize the component. Initialize ADCControl, Leds
Returns: returns SUCCESS or FAILED

StdControl.start

command result_t StdControl.start (void)

Starts the timer.
Returns: The value of calling Timer.start().

StdControl.stop

command result_t StdControl.stop (void)

Stops the timer.
Returns: The value of calling Timer.stop().

Timer.fired

event result_t Timer.fired (void)

Read sensor data in response to the Timer.fired event.
Returns: The value of calling ADC.getData().

ADC.dataReady

async event result_t ADC.dataReady (uint16_t data)

In response to ADC.dataReady, store sensor data and post task for averaging.
Returns: returns SUCCESS