mbed Sensor node for Instrumented Booth over ETH.

Dependencies:   EthernetInterface-1 MaxbotixDriver Presence HTU21D_TEMP_HUMID_SENSOR_SAMPLE Resources SHARPIR mbed-rtos mbed-src WDT_K64F nsdl_lib

Fork of Trenton_Switch_LPC1768_ETH by Demo Team

Files at this revision

API Documentation at this revision

Comitter:
andcor02
Date:
Fri Dec 12 16:46:43 2014 +0000
Parent:
32:c957a1948ac1
Child:
35:b0c1b676403a
Commit message:
implemented height with tighter control and count variable, threshold on ir needs maybe tweaking to improve response and noise suppression. In very working state.

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
mbed-src.lib Show annotated file Show diff for this revision Revisions of this file
sensor_ctl.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/EthernetInterface.lib	Thu Dec 11 17:15:04 2014 +0000
+++ b/EthernetInterface.lib	Fri Dec 12 16:46:43 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/EthernetInterface/#de796e2a5e98
+http://developer.mbed.org/users/andcor02/code/EthernetInterface/#eb44cf92c7a3
--- a/mbed-src.lib	Thu Dec 11 17:15:04 2014 +0000
+++ b/mbed-src.lib	Fri Dec 12 16:46:43 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-src/#8eeb5157dee4
+http://mbed.org/users/mbed_official/code/mbed-src/#cef2a8a56f9e
--- a/sensor_ctl.cpp	Thu Dec 11 17:15:04 2014 +0000
+++ b/sensor_ctl.cpp	Fri Dec 12 16:46:43 2014 +0000
@@ -29,7 +29,7 @@
 Presence kiosk(PTB10, true, KIOSK_SENSOR_DEBOUNCE_MS); //(Interrupt pinrequired, no timeout)
 #endif //NODE KIOSK STATION
 #if NODE_DOOR_TRIP_STATION
-SHARPIR sharpir(PTC11); //(AnalogIn required), for IR door trip
+SHARPIR sharpir(PTB10); //(AnalogIn required), for IR door trip
 #endif //NODE TRIP STATION
 #if NODE_HEIGHT_STATION
 Timer sonarTimer;
@@ -59,7 +59,7 @@
 //Door Height...
 float door_height_max_value = 0;
 bool door_height_measuring = 0;
-bool door_height_sample_count = 0;
+int door_height_sample_count = 0;
     
     
 //Initialisation
@@ -129,10 +129,11 @@
 #if NODE_DOOR_TRIP_STATION
 void handle_door_trip_report_timer(){
     float value= sharpir.volt();
+    printf ("\n\r door:%f", value);
     bool new_door_trip = 0;
-    if (value>door_trip_starting_volts+0.15) {
+    if (value>door_trip_starting_volts+0.2) {
         new_door_trip=true;
-    } else if (value<door_trip_starting_volts+0.15) {
+    } else if (value<door_trip_starting_volts+0.2) {
         new_door_trip=false;
     }
     
@@ -146,6 +147,7 @@
 #if NODE_HEIGHT_STATION
 void handle_door_height_sample_timer(){
     int height_sample = DOOR_HEIGHT_SENSOR_MOUNT_HEIGHT_CM-sonar.read();
+    printf("\n\r %d", height_sample);
     if(height_sample > DOOR_HEIGHT_START_MEASURING_THRESHOLD_CM) {
         door_height_sample_count=0;
         if (height_sample > door_height_max_value) {