Geo beacon for VF.
Dependencies: MMA8452 aconno_bsp adc52832_common
Revision 36:36d44b58980a, committed 2018-01-18
- Comitter:
- jurica238814
- Date:
- Thu Jan 18 10:46:55 2018 +0000
- Parent:
- 35:7917a7f951c7
- Child:
- 37:4b38af411b64
- Commit message:
- Buzz time and pause changed.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Jan 18 09:57:45 2018 +0000
+++ b/main.cpp Thu Jan 18 10:46:55 2018 +0000
@@ -45,6 +45,9 @@
#define INT2_PIN (p4)
#define BUZZER (p31)
+#define BUZZER_ON_TIME_S (0.250)
+#define BUZZER_OFF_TIME_S (0.050)
+
#if DEBUG_PRINT_UART
#include "nrf52_uart.h"
NRF52_UART uart(p25, p26, Baud9600);
@@ -109,12 +112,16 @@
buzzer.enableChannel(0, BUZZER);
buzzer.setDuty(0,0.5f);
initState = 0;
+ toggleBuzzer.detach();
+ toggleBuzzer.attach(buzzerToggle, BUZZER_OFF_TIME_S);
}
else{
buzzer.enable(0);
buzzer.setDuty(0, 0);
buzzer.disable();
initState = 1;
+ toggleBuzzer.detach();
+ toggleBuzzer.attach(buzzerToggle, BUZZER_ON_TIME_S);
}
}
@@ -191,7 +198,7 @@
wait_ms(100);
#endif
//buzzerStart();
- toggleBuzzer.attach(buzzerToggle, 0.250);
+ toggleBuzzer.attach(buzzerToggle, BUZZER_ON_TIME_S);
return;
}
}

