Geo beacon for VF.
Dependencies: MMA8452 aconno_bsp adc52832_common
Revision 29:7b794a8633b4, committed 2017-09-14
- Comitter:
- jurica238814
- Date:
- Thu Sep 14 13:32:06 2017 +0000
- Parent:
- 28:7b71c61d2160
- Child:
- 30:a37aa31fb84e
- Commit message:
- ACC included. Power consumption in sleep: 33uA.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Sep 14 12:43:51 2017 +0000
+++ b/main.cpp Thu Sep 14 13:32:06 2017 +0000
@@ -21,9 +21,9 @@
#define DEBUG_PRINT_UART (0)
#define DEBUG_MAC (0)
#define DEBUG_CONNECTION (0)
-#define DEBUG_WAKEUP_BUZZER (0)
+#define DEBUG_WAKEUP_BUZZER (1)
-#define USE_ACC (0)
+#define USE_ACC (1)
#define SLEEP_TIME_S (7.00) /* Sleep time (in s) */
#define ADV_TIMER_TIME_S (0.30) /* Advertising time (in s) */
@@ -465,7 +465,7 @@
// Setup for the interrupt handler
accPulse.rise(&pulse_handler); // -------------------------------------
//acc.set_register((char)CTRL_REG_1, (char)0xF9); // Flow data rate and Active mode
- acc.set_register((char)CTRL_REG_1, (char)0x38); // Flow data rate and Active mode
+ acc.set_register((char)CTRL_REG_1, (char)0xF9); // Flow data rate and Active mode
acc.set_register((char)CTRL_REG_2, (char)0x1B); // Set Low power mode
wait(1);
#endif
@@ -473,11 +473,11 @@
/* SpinWait for initialization to complete. This is necessary because the BLE object is used in the main loop below. */
while (ble.hasInitialized() == false){ /* spin loop */ }
- /*
+
buzzerStart();
wait_ms(500);
buzzerStop();
- */
+
while(true){
ble.waitForEvent();

