2011-02-22 11:57:41 +00:00
|
|
|
#include "contiki.h"
|
|
|
|
|
|
|
|
#include "dev/potentiometer-sensor.h"
|
|
|
|
#include <stdio.h> /* For printf() */
|
|
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/
|
2011-03-04 14:54:21 +00:00
|
|
|
PROCESS(aplicacio, "Testing Potentiometer");
|
2011-02-22 11:57:41 +00:00
|
|
|
AUTOSTART_PROCESSES(&aplicacio);
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
PROCESS_THREAD(aplicacio, ev, data)
|
|
|
|
{
|
|
|
|
|
|
|
|
PROCESS_BEGIN();
|
|
|
|
|
2011-03-04 14:54:21 +00:00
|
|
|
// INSERT LINE HERE TO ENABLE POTENTIOMETER
|
|
|
|
|
2011-02-22 11:57:41 +00:00
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
|
2011-03-04 14:54:21 +00:00
|
|
|
uint16_t value
|
|
|
|
//INSERT LINE HERE TO READ POTENTIOMETER VALUE
|
|
|
|
|
2011-02-22 11:57:41 +00:00
|
|
|
printf("Potentiometer Value: %i\n", v);
|
|
|
|
}
|
|
|
|
|
|
|
|
SENSORS_DEACTIVATE(potentiometer_sensor);
|
|
|
|
|
|
|
|
|
|
|
|
PROCESS_END();
|
|
|
|
}
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
|