yeah
Dependencies: Hexi_KW40Z BLE_API Hexi_OLED_SSD1351
Revision 0:3ae5810b098e, committed 2019-05-04
- Comitter:
- deven810
- Date:
- Sat May 04 22:17:57 2019 +0000
- Commit message:
- yeah;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BLE_API.lib Sat May 04 22:17:57 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/teams/Bluetooth-Low-Energy/code/BLE_API/#65474dc93927
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Hexi_KW40Z.lib Sat May 04 22:17:57 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/teams/Hexiwear/code/Hexi_KW40Z/#3f5ed7abc5c7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Hexi_OLED_SSD1351.lib Sat May 04 22:17:57 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/teams/Hexiwear/code/Hexi_OLED_SSD1351/#ae5fad429790
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat May 04 22:17:57 2019 +0000
@@ -0,0 +1,47 @@
+#include "mbed.h"
+#include "Hexi_KW40Z.h"
+#include "Hexi_OLED_SSD1351.h"
+#include "OLED_types.h"
+#include "OpenSans_Font.h"
+#include "string.h"
+
+#define LED_ON 0
+#define LED_OFF 1
+
+KW40Z kw(PTE24, PTE25); //24 - Tx, 25 - Rx
+SSD1351 oled(PTB22,PTB21,PTC13,PTB20,PTE6, PTD15); /* (MOSI,SCLK,POWER,CS,RST,DC) */
+
+int main() {
+ char text[20];
+
+ oled.DimScreenON();
+
+ oled.FillScreen(COLOR_BLACK);
+ oled_text_properties_t textProperties = {0};
+ oled.GetTextProperties(&textProperties);
+ textProperties.fontColor = COLOR_WHITE;
+ oled.SetTextProperties(&textProperties);
+
+// /* Display Bluetooth Label at x=17,y=65 */
+// strcpy((char *) text,"BLUETOOTH");
+// oled.Label((uint8_t *)text,17,65);
+
+// /* Change font color to white */
+// textProperties.fontColor = COLOR_WHITE;
+// textProperties.alignParam = OLED_TEXT_ALIGN_CENTER;
+// oled.SetTextProperties(&textProperties);
+//
+// /* Display Label at x=22,y=80 */
+// strcpy((char *) text,"Tap Below");
+// oled.Label((uint8_t *)text,22,80);
+// strcpy((char *)text, "hello world");
+// oled.TextBox((uint8_t *)text, 0,0,95, 18);
+ sprintf(text, "%d %d %d", kw.GetPassKey(), kw.GetLinkState(), kw.GetAdvertisementMode());
+ oled.TextBox((uint8_t *)text, 0,0,95, 18);
+ int prev = kw.GetLinkState();
+ kw.ToggleAdvertisementMode();
+ while(true) {
+ sprintf(text, "%d %d", kw.GetLinkState(), kw.GetAdvertisementMode());
+ oled.TextBox((uint8_t *)text, 0,20,95, 18);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Sat May 04 22:17:57 2019 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#cfa7938a4dd6d1a4c501945b9c26ca68f70e284e