diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-01-11 12:24:36 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-01-11 12:24:36 +0100 |
commit | a50f58aed59d325dc73da795df2a5cf4253c171f (patch) | |
tree | 6ab9ee218e9d3e2112a1b13764b2b9d24be56389 | |
parent | 9c3ff3ca4ac5eb076fd6add2e5f14c294e915567 (diff) | |
download | trygvisio_soil_moisture-a50f58aed59d325dc73da795df2a5cf4253c171f.tar.gz trygvisio_soil_moisture-a50f58aed59d325dc73da795df2a5cf4253c171f.tar.bz2 trygvisio_soil_moisture-a50f58aed59d325dc73da795df2a5cf4253c171f.tar.xz trygvisio_soil_moisture-a50f58aed59d325dc73da795df2a5cf4253c171f.zip |
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.
-rw-r--r-- | app.cpp | 5 | ||||
-rw-r--r-- | app.h | 2 |
2 files changed, 4 insertions, 3 deletions
@@ -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]; @@ -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 { |