From a50f58aed59d325dc73da795df2a5cf4253c171f Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 11 Jan 2015 12:24:36 +0100 Subject: o Adding another sensor for prototype board #1. o Fixing a bug, the values are 10 bits so they need a uint16_t to fit. --- app.cpp | 5 +++-- app.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app.cpp b/app.cpp index 606864d..7c5507a 100644 --- a/app.cpp +++ b/app.cpp @@ -7,14 +7,14 @@ #undef PROGMEM #define PROGMEM __attribute__((section(".progmem.data"))) -#define SENSOR_COUNT 1 +#define SENSOR_COUNT 2 // See http://redbearlab.com/blendmicro/ for pins. struct sm_sensor { uint8_t a_pin; uint8_t d1_pin; uint8_t d2_pin; - uint8_t value; + uint16_t value; uint16_t warning_value; uint16_t update_interval; uint8_t name_length; @@ -22,6 +22,7 @@ struct sm_sensor { } sensors[SENSOR_COUNT] = { // A Pin, D1 Pin, D2 Pin, Value, Warning Value, Update Interval, Length of Name, Name { 8, 3, 5, 0, 10, 0, 9, 'sensor #1'}, + { 10, 11, 12, 0, 10, 0, 9, 'sensor #2'}, }; static unsigned long next_update[SENSOR_COUNT]; diff --git a/app.h b/app.h index 5039c0e..f1b829a 100644 --- a/app.h +++ b/app.h @@ -29,7 +29,7 @@ struct sm_get_value_req { }; struct sm_get_value_res { - uint8_t value; + uint16_t value; }; struct sm_set_warning_value_req { -- cgit v1.2.3