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