Compilation flags update: BOARD=ids01a4/5 SENSORBOARD=iks01a1
This commit is contained in:
parent
4e81c87c3a
commit
e261cda8dc
20 changed files with 101 additions and 97 deletions
|
@ -2,7 +2,7 @@ CONTIKI_PROJECT = sensor-demo
|
|||
all: $(CONTIKI_PROJECT)
|
||||
|
||||
TARGET=stm32nucleo-spirit1
|
||||
USE_SENSOR_BOARD=1
|
||||
SENSORBOARD=iks01a1
|
||||
|
||||
CONTIKI = ../../..
|
||||
include $(CONTIKI)/Makefile.include
|
||||
|
|
|
@ -9,9 +9,9 @@ must be used. It needs to be connected on top of the NUCLEO-L152RE (MCU) and the
|
|||
|
||||
To build the example type:
|
||||
|
||||
make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A4 USE_SENSOR_BOARD=1
|
||||
make TARGET=stm32nucleo-spirit1 BOARD=ids01a4 SENSORBOARD=iks01a1
|
||||
or
|
||||
|
||||
make TARGET=stm32nucleo-spirit1 USE_SUBGHZ_BOARD=IDS01A5 USE_SENSOR_BOARD=1
|
||||
make TARGET=stm32nucleo-spirit1 BOARD=ids01a5 SENSORBOARD=iks01a1
|
||||
|
||||
depending on the sub GHz board you have.
|
||||
depending on the X-NUCLEO-IDS01Ax expansion board for sub GHz radio connectivity you have.
|
||||
|
|
|
@ -44,14 +44,14 @@
|
|||
|
||||
#include "st-lib.h"
|
||||
|
||||
#ifdef COMPILE_SENSORS
|
||||
#ifdef X_NUCLEO_IKS01A1
|
||||
#include "dev/temperature-sensor.h"
|
||||
#include "dev/humidity-sensor.h"
|
||||
#include "dev/pressure-sensor.h"
|
||||
#include "dev/magneto-sensor.h"
|
||||
#include "dev/acceleration-sensor.h"
|
||||
#include "dev/gyroscope-sensor.h"
|
||||
#endif /*COMPILE_SENSORS*/
|
||||
#endif /*X_NUCLEO_IKS01A1*/
|
||||
|
||||
#define DEBUG DEBUG_PRINT
|
||||
#include "net/ip/uip-debug.h"
|
||||
|
@ -75,14 +75,14 @@ PROCESS_THREAD(sensor_demo_process, ev, data)
|
|||
|
||||
SENSORS_ACTIVATE(radio_sensor);
|
||||
|
||||
#ifdef COMPILE_SENSORS
|
||||
#ifdef X_NUCLEO_IKS01A1
|
||||
SENSORS_ACTIVATE(temperature_sensor);
|
||||
SENSORS_ACTIVATE(humidity_sensor);
|
||||
SENSORS_ACTIVATE(pressure_sensor);
|
||||
SENSORS_ACTIVATE(magneto_sensor);
|
||||
SENSORS_ACTIVATE(acceleration_sensor);
|
||||
SENSORS_ACTIVATE(gyroscope_sensor);
|
||||
#endif
|
||||
#endif /*X_NUCLEO_IKS01A1*/
|
||||
|
||||
while(1) {
|
||||
etimer_set(&etimer, PRINT_INTERVAL);
|
||||
|
@ -98,17 +98,17 @@ PROCESS_THREAD(sensor_demo_process, ev, data)
|
|||
printf("Button state:\t%s (pressed %lu times)\n", button_sensor.value(0) ? "Released" : "Pressed",
|
||||
_button_pressed);
|
||||
|
||||
#ifdef COMPILE_SENSORS
|
||||
#ifdef X_NUCLEO_IKS01A1
|
||||
printf("LEDs status:\tRED:n/a GREEN:%s\n", leds_get() & LEDS_GREEN ? "on" : "off");
|
||||
#else
|
||||
printf("LEDs status:\tRED:%s GREEN:%s\n", leds_get() & LEDS_RED ? "on" : "off",
|
||||
leds_get() & LEDS_GREEN ? "on" : "off");
|
||||
#endif /*COMPILE_SENSORS*/
|
||||
#endif /*X_NUCLEO_IKS01A1*/
|
||||
sensor_value = radio_sensor.value(RADIO_SENSOR_LAST_PACKET);
|
||||
printf("Radio (RSSI):\t%d.%d dBm\n", sensor_value / 10, ABS_VALUE(sensor_value) % 10);
|
||||
printf("Radio (LQI):\t%d\n", radio_sensor.value(RADIO_SENSOR_LAST_VALUE));
|
||||
|
||||
#ifdef COMPILE_SENSORS
|
||||
#ifdef X_NUCLEO_IKS01A1
|
||||
sensor_value = temperature_sensor.value(0);
|
||||
printf("Temperature:\t%d.%d C\n", sensor_value / 10, ABS_VALUE(sensor_value) % 10);
|
||||
|
||||
|
@ -134,7 +134,7 @@ PROCESS_THREAD(sensor_demo_process, ev, data)
|
|||
printf("Gyroscope:\t%d/%d/%d (X/Y/Z) mdps\n", gyroscope_sensor.value(X_AXIS),
|
||||
gyroscope_sensor.value(Y_AXIS),
|
||||
gyroscope_sensor.value(Z_AXIS));
|
||||
#endif
|
||||
#endif /*X_NUCLEO_IKS01A1*/
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue