HRV -> Mood
Dependencies: MAX30101 Hexi_KW40Z Hexi_OLED_SSD1351
Diff: 8cee5929f4d8/main.cpp
- Revision:
- 18:0d1ef7ea9d4b
- Parent:
- 17:611a14bc8afd
- Child:
- 19:f9f76e6d0c68
--- a/8cee5929f4d8/main.cpp Mon Mar 18 01:03:38 2019 +0000
+++ b/8cee5929f4d8/main.cpp Mon Mar 18 02:19:36 2019 +0000
@@ -82,6 +82,18 @@
haptic = 0;
hapticTimer.stop();
}
+
+void PassKey(void)
+{
+ StartHaptic();
+ strcpy((char *) text,"PAIR CODE");
+ oled.TextBox((uint8_t *)text,0,25,95,18);
+
+ /* Display Bond Pass Key in a 95px by 18px textbox at x=0,y=40 */
+ sprintf(text,"%d", kw40z_device.GetPassKey());
+ oled.TextBox((uint8_t *)text,0,40,95,18);
+}
+
void txTask(void)
{
@@ -482,6 +494,7 @@
t.start(callback(&evqueue, &EventQueue::dispatch_forever));
kw40z_device.attach_buttonLeft(&ButtonLeft);
kw40z_device.attach_buttonRight(&ButtonRight);
+ kw40z_device.attach_passkey(&PassKey);
pwr1v8 = 1;
pwr3v3b = 1;
@@ -515,6 +528,8 @@
txThread.start(txTask);
+
+
while (true) {
// Format the time reading