From d39b5c8ff8ad27a877a71f3588d3923b76493dfc Mon Sep 17 00:00:00 2001 From: gsd Date: Sun, 24 Nov 2024 20:35:07 +0300 Subject: [PATCH] final --- bat_lvl_scheme.JPG | Bin 0 -> 46655 bytes main/main.ino | 72 ++++++++++++++++++++++++++++++++------------- 2 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 bat_lvl_scheme.JPG diff --git a/bat_lvl_scheme.JPG b/bat_lvl_scheme.JPG new file mode 100644 index 0000000000000000000000000000000000000000..5a8da666d09c3610f1a00a5ff922740dddfd8ac5 GIT binary patch literal 46655 zcmeFZ2_Ti*{y+SfB8klNP>2#T&$g0GNh)(FLt=+anQcSnDTGoPl7x^ll&~|CBD0Kb zB(uGZ+qUifF5P?1t?oJZo_l}y|9kKMeUEzT*^jl?v(|U5^&LLn&sxMm;%Df9&S~w_ z5D5thbQ%1Ch$zx-4R4355TvIE9fcr>3L+;_f=Iy~xxKqB6yX4ogL@M2SLeaQ-Ty%e zh_rr=3!((iXuxMxa6w#i;Gf;!{`mtz6t~H~NstLh>h5jwU+l9HmJgs8iZ zv&R*0QD=AlzgBR{&fUh%;f9BUi!!@3yrOx4UlVWasSR4x}L= zen|W;js8!)6Nu>7m;R>sK_5XGMRhm3D;{>Iz@@r7oS-M7lF}D{8DcRxDFtQmpUNqV z?+W9)hW=+;{)eQcs%&ecXtUdP7q`E>{(_zB|7^6cJE#Ix`&YfbdZxJMfa(W7egAyn9FdAH;JmktG z8Jw6+#ecH2j`@5ST0qL$Eo3h>3o9Ethu~o$;Uh<-Wn|^#6%^G^X`I&7($=|f(a^}) z#MI2j*6ynPH3vs`56_!k-afvex5C0BBBP>{lJBIXrro`l{wU{h?vuQy`2{atmX%jj zzIt6%-_Y39+|t_iuDhqVuYX|h(-3N6a_Y zKlO_q^ox|7oQ#}uw_hZrUf?35C#N_lv4`P=0p%4}#zT_9R7@umvrFst@=KjZGh4fL zQL_k0qXaR#UHjIvKi093f2(J|cIJRHGM>`ykAh72^A{$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Ccc4%%z5sxAns)0pHy8;wo>T*H$#Qxb_M3f&iAf{RXrKvv9l?dSH zpQi`1xSzB4|KZ+CAsZ3*Of7pr8E0~CFC+rwFeL8EY~dyt@8W&NyG<0)A_6MF$vsyy z@Hw(AQj*-=>iY&U+kSm@f&C7lreWEVhvfe7)a3QRH1U$&3G3Fxld^j?MoUNPi{$fz zu0}q{HzWDub@Ta4P#1>J$DT$y#{R*S8pUIrxUz}K15cS_{{zNV`$SMmSU zYl&+l{DbQ4$ZL-}TJhdqlC3Q(aMY>f-JL>2(SQ15S^Wp#cy( z;hf;SAn^vlNPK*Gen9mu2djFc_gABDE40%|qchF-uf%KfXsu;mFXs=s=a$#^@1bh` zvkdNs-p|v*TZN)<+=TGLfoxcg{guaEGuCVKhGUTH6Hi{l%F6H4&-u|n>%F%2&%U;> zJY1vYE)8-H&bncK*fylx;g@M=K%P{3D5(}VA|U50sZU0HVaobLrvNNs|AWUVkFa~I zg_-wuTfKBQh+;y9%D+q4KzT1N$0*Yu-Qa@GAi7SW(A5R0QbV_aeiUX$BGGoE*t@w86gcI zZV{be7qe{yDnp8(TxHa>;T!u~vGhg}9=5)N2Spac11f|Ys{RyFloAqALt%3USm9^2 zL`hN%*rS>OF0oA+Fs%g$@!tAibFv0IR{*aS+3~Yp;?L9jIeV0!_ukJ(1H{Px#S4p? z*GSma`-6ydBtrA#2%1OE^B$KPfE literal 0 HcmV?d00001 diff --git a/main/main.ino b/main/main.ino index df9cddc..3e0a440 100644 --- a/main/main.ino +++ b/main/main.ino @@ -5,6 +5,8 @@ #include //#define DEBUG 1 +#define BAT_SUPPORT 1 +#define EXTERNAL_RGB_LED_SUPPORT 1 using namespace fabgl; @@ -24,21 +26,42 @@ static std::map _virtualKeyMap; uint8_t convertToKeyCode(VirtualKey virtualKey); -#define LED_RED 26 -#define LED_GREEN 27 -#define LED_BLUE 25 - -static bool numlockLed = false; -static bool capslockLed = false; -static bool scrolllockLed = false; +#if defined (EXTERNAL_RGB_LED_SUPPORT) + #define LED_RED 26 + #define LED_GREEN 27 + #define LED_BLUE 25 +#endif + +#if defined (BAT_SUPPORT) + #define BAT_ANALOG 15 + float lastBatteryStatusPublish = -61.0f; + void updateBatteryStatus() { + if (esp_timer_get_time()/1000 - lastBatteryStatusPublish > 60) { + uint8_t lvl = map(analogRead(BAT_ANALOG), 0.0f, 4095.0f, 0, 100); + bleKeyboard.setBatteryLevel(lvl); + lastBatteryStatusPublish = esp_timer_get_time()/1000; + } + } +#endif void setup() { + #if defined (EXTERNAL_RGB_LED_SUPPORT) + pinMode(LED_RED, OUTPUT); + pinMode(LED_GREEN, OUTPUT); + pinMode(LED_BLUE, OUTPUT); + digitalWrite(LED_RED, HIGH); + #endif + #if defined(DEBUG) Serial.begin(115200); Serial.println("Starting"); #endif + #if defined (BAT_SUPPORT) + updateBatteryStatus(); + #endif + bleKeyboard.setName("Chicony KB-5191"); bleKeyboard.begin(); @@ -48,17 +71,17 @@ void setup() Serial.println("Started"); #endif - pinMode(LED_RED, OUTPUT); - pinMode(LED_GREEN, OUTPUT); - pinMode(LED_BLUE, OUTPUT); - digitalWrite(LED_GREEN, HIGH); - keyboard->setLayout(&fabgl::USLayout); const KeyboardLayout* layout = keyboard->getLayout(); for (AltVirtualKeyDef keyDef: layout->alternateVK) { _virtualKeyMap[keyDef.virtualKey] = keyDef.reqVirtualKey; } + + #if defined (EXTERNAL_RGB_LED_SUPPORT) + digitalWrite(LED_RED, LOW); + digitalWrite(LED_GREEN, HIGH); + #endif } static void updateModifiers(VirtualKey virtualKey, bool keyDown) @@ -165,11 +188,15 @@ void loop() if (!bleKeyboard.isConnected()) { connected = false; + #if defined(DEBUG) Serial.println("Disconnected"); #endif - digitalWrite(LED_GREEN, HIGH); - digitalWrite(LED_BLUE, LOW); + + #if defined (EXTERNAL_RGB_LED_SUPPORT) + digitalWrite(LED_GREEN, HIGH); + digitalWrite(LED_BLUE, LOW); + #endif } } else @@ -177,11 +204,15 @@ void loop() if (bleKeyboard.isConnected()) { connected = true; + #if defined(DEBUG) Serial.println("Connected"); #endif - digitalWrite(LED_GREEN, LOW); - digitalWrite(LED_BLUE, HIGH); + + #if defined (EXTERNAL_RGB_LED_SUPPORT) + digitalWrite(LED_GREEN, LOW); + digitalWrite(LED_BLUE, HIGH); + #endif } } @@ -200,6 +231,10 @@ void loop() updateModifiers(virtualKey, keyDown); uint8_t keyCode = convertToKeyCode(virtualKey); + #if defined (BAT_SUPPORT) + updateBatteryStatus(); + #endif + #if defined(DEBUG) Serial.print("After convertToKeyCode: "); Serial.print(virtualKey); @@ -332,11 +367,8 @@ uint8_t convertToKeyCode(VirtualKey virtualKey) case VK_SLASH: case VK_QUESTION: return 0x38; - case VK_CAPSLOCK: { - //capslockLed = !capslockLed; - //keyboard->setLEDs(numlockLed, capslockLed, scrolllockLed); + case VK_CAPSLOCK: return 0x39; - } case VK_F1...VK_F12: return 0x3A + (virtualKey - VK_F1);