Geo beacon for VF.
Dependencies: MMA8452 aconno_bsp adc52832_common
Diff: main.cpp
- Revision:
- 11:92a9fffd5015
- Parent:
- 10:fd91664032d8
- Child:
- 12:6b072c2a061c
--- a/main.cpp Tue Jul 25 09:22:32 2017 +0000 +++ b/main.cpp Tue Jul 25 11:29:01 2017 +0000 @@ -16,10 +16,10 @@ #define DEBUG_ACC (0) #define SLEEP_TIME (2.0) // Sleep time in seconds WAS 0.85 -#define AWAKE_TIME (3.0) // Was 0.15 -#define ADV_TIMER_TIME (1.0) // Advertising time (in s) -#define SCAN_TIMER_TIME (2.0) // Scanning time (in s) +#define ADV_TIMER_TIME (0.1) // Advertising time (in s) +#define SCAN_TIMER_TIME (0.5) // Scanning time (in s) #define FREE_TIME (0.01) // Time between end of a scanning and sleep mode +#define AWAKE_TIME (ADV_TIMER_TIME+SCAN_TIMER_TIME+FREE_TIME) // Was 0.15 /* Static constants for the BLE example */ #define MAX_BLE_PACKET_SIZE (31) @@ -159,7 +159,7 @@ if ((params->advertisingData[msdOffset+1]) == 0x59){ if ((params->advertisingData[msdOffset+2]) == 0x00){ for(i=0; i<6; i++){ - if((params->advertisingData[msdOffset+i+3]) == my_mac_address[5-i] || 1){ + if((params->advertisingData[msdOffset+i+3]) == my_mac_address[5-i]){ continue; } else{ @@ -170,8 +170,6 @@ WakeSleepT.detach(); buzzer.write(0.5F); turnBuzzOffT.attach(turnBuzzOff, BUZZ_TIME); - //wait_ms(40); - //buzzer.write(0.0F); } } }