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
Revision 28:908a6f58aa7f, committed 2014-12-05
- Comitter:
- erigow01
- Date:
- Fri Dec 05 13:57:36 2014 +0000
- Parent:
- 27:6017a643f386
- Child:
- 29:9599a156f78b
- Commit message:
- Continued sensor integration.
Changed in this revision
--- a/Presence/Presence.cpp Wed Dec 03 17:33:34 2014 +0000 +++ b/Presence/Presence.cpp Fri Dec 05 13:57:36 2014 +0000 @@ -16,15 +16,15 @@ { debounce_ms = debounce_time_ms; _true_on_rise = true_on_rise; - if(true_on_rise) { - _myint.rise(this, &Presence::presence_interrupt_off); - _myint.fall(this, &Presence::presence_interrupt_on); - } else { - _myint.rise(this, &Presence::presence_interrupt_on); - _myint.fall(this, &Presence::presence_interrupt_off); - } +// if(true_on_rise) { +// _myint.rise(this, &Presence::presence_interrupt_off); +// _myint.fall(this, &Presence::presence_interrupt_on); +// } else { +// _myint.rise(this, &Presence::presence_interrupt_on); +// _myint.fall(this, &Presence::presence_interrupt_off); +// } _detection=false; - debounce_timer.start(); +// debounce_timer.start(); _led1=1; } @@ -45,10 +45,10 @@ } bool Presence::isPresent(){ - if (debounce_timer.read_ms() > debounce_ms) { +// if (debounce_timer.read_ms() > debounce_ms) { //Poll the pin and update value... _detection = (_true_on_rise && _myint == 1) || (!_true_on_rise && _myint == 0); if(_detection) _led1 = 0; else _led1 = 1; - } +// } return _detection; } \ No newline at end of file
--- a/node_cfg.h Wed Dec 03 17:33:34 2014 +0000 +++ b/node_cfg.h Fri Dec 05 13:57:36 2014 +0000 @@ -2,6 +2,12 @@ #define NODE_CFG_H_ /************** NODE PROFILE SELECTION ***********************/ + +//Which Radio +#define NODE_6LOWPAN 0 +#define NODE_ETHERNET 1 + +//Which Sensors #define NODE_SENSOR_STATION 1 // use K64F platform. Base sensor platform. Includes Microphone, temperature. #define NODE_HEIGHT_STATION 0 // use K64F platform. This include door height sensor #define NODE_KIOSK_STATION 1 // use K64F platform. This includes kiosk presence sensor @@ -11,7 +17,6 @@ /*************** NODE PROFILE CONFIGURATION *****************/ - #define NODE_SHORT_ADDRESS 4 #define NODE_MAC_ADDRESS {0,0,6,0x02,0x00,0x00,0x09,0x01} #define NODE_NAME "mbed-sensor-station-eth" @@ -34,12 +39,18 @@ // **************************************************************************** + + /************** REGISTRATION PARAMETERS ************************/ -#define RD_UPDATE_PERIOD_MS 30000 // 30 seconds - -//#define NSP_IP_ADDRESS_BYTES {0x20, 0x02, 0x0d, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x01} //IPv6 +#define RD_UPDATE_PERIOD_MS 300000 // 5 minutes #define NSP_IP_ADDRESS "192.168.1.100" //IPv4 + +#ifdef NODE_6LOWPAN +#define NSP_IP_ADDRESS_BYTES {0x20, 0x02, 0x0d, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x02, 0x00, 0x01} //IPv6 +#else +//Default to IPv4 #define NSP_IP_ADDRESS_BYTES {0xc0, 0xa8, 0x01, 0x64} //IPv4 +#endif // NODE_6LOW_PAN #endif // NODE_CFG_H_ \ No newline at end of file
--- a/sensor_ctl.cpp Wed Dec 03 17:33:34 2014 +0000 +++ b/sensor_ctl.cpp Fri Dec 05 13:57:36 2014 +0000 @@ -23,10 +23,10 @@ RHT03 temperature(PTB2); MAX9814 microphone(PTB3); //Analogue in required. #if NODE_PIR_STATION -Presence pir(PTB11, false, 5000); //(InterruptPin), for PIR sensor, +Presence pir(PTB11, false, PIR_SENSOR_DEBOUNCE_MS); //(InterruptPin), for PIR sensor, #endif //NODE PIR STATION #if NODE_KIOSK_STATION -Presence kiosk(PTB10, true, 500); //(Interrupt pinrequired, no timeout) +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
--- a/sensor_ctl.h Wed Dec 03 17:33:34 2014 +0000 +++ b/sensor_ctl.h Fri Dec 05 13:57:36 2014 +0000 @@ -13,6 +13,8 @@ #define DOOR_TRIP_REPORT_PERIOD_MS 1000 // Every Second. #define KIOSK_REPORT_PERIOD_MS 1000 // Every Second +#define KIOSK_SENSOR_DEBOUNCE_MS 500 +#define PIR_SENSOR_DEBOUNCE_MS 5000 //Externally visible values. extern float current_temperature_value;