研究筆記-LightBlue Bean+
編輯歷史
| 時間 | 作者 | 版本 |
|---|---|---|
| 2017-01-11 01:10 – 01:27 | r233 – r328 | |
顯示 diff(19 行未修改)
The current battery voltage is: 3.05V
The remaining battery life is: %70
+
+ 小品分享
+ *研究板子中,突然有人需要一個功能,剛好用這個板子做很有趣。隨手就做了一個
+ *需求:八個外部按鈕,按下第一個按鈕,當作鍵盤敲下 '1', 其餘類推。按鈕跟電腦有點距離,不適合接線。
+ *
+ *作法:板子 GPIO0-7, 連接按鈕接地。板子模擬當成藍牙鍵盤,當判斷按鈕被按過,就輸出 Keycode 給遠端電腦。
+ *
+ *結果:如 code, 能基本運作,只能說板子太強大好用了,半小時完成的東西,就別要求細節了。
+ *
+ */*
+ * * Main logic: press GPIO_0 , send keycode '1' to PC, GPIO_n -> keycode n+1'
+ * * GPIO setup as default PULLUP, suggest to connect to GND
+ * * Hardcode support GPIO 0-7
+ **/
+ *void setup() {
+ * BeanHid.enable();
+ * // Serial port is initialized automatically; we don't have to do anything
+ * Serial.begin();
+ * int i;
+ * for(i=0;i<8;i++){
+ * pinMode(i, INPUT_PULLUP);
+ * }
+ *}
+ *int id_down_cur=-1; // current gpio id pressing
+ *// return >=0 if One button released, default return -1
+ *int GetButtonPressId(){
+ * int i,value;
+ * if(id_down_cur>=0){
+ * value = digitalRead(id_down_cur);
+ * if(value==1){
+ * //Bean.setLed(0, 255, 0);
+ * return id_down_cur;
+ * }
+ * }
+ * for(i=0;i<8;i++){
+ * value = digitalRead(i);
+ * if(value==0) {
+ * id_down_cur=i;
+ * //Bean.setLed(255, 0, 0);
+ * }
+ * }
+ * return -1;
+ *}
+ *
+ *void loop() {
+ * int gpioid;
+ * char c;
+ * gpioid = GetButtonPressId();
+ * if( gpioid>=0 ) {
+ * c = 0x31+gpioid;
+ * //Serial.println(c);
+ * id_down_cur = -1;
+ * BeanHid.sendKey(c);
+ * Bean.sleep(50); // try to protect input variant from button
+ * }
+ * Bean.sleep(10);
+ *
+ *
+ *}
+ *
參考
*PunchThrough LightBlue Bean+
(3 行未修改)
|
||
| 2017-01-07 23:11 – 23:11 | r231 – r232 | |
顯示 diff(13 行未修改)
Cannot find bean’s serial port in Arduino IDE
*To work around: cat /tmp/cu.LightBlue-Bean
+ *screen /tmp/cu.LightBlue-Bean 9600
Battery Status
(9 行未修改)
|
||
| 2017-01-07 15:16 – 15:16 | r226 – r230 | |
顯示 diff(4 行未修改)
很久以前看這個板子的介紹就很喜歡,主要是可以透過 藍芽升級 Arduino code.年前為了免運,順便敗了這個。
- Learn Check List
+ *Learn Check List
*Setup
*Program
(17 行未修改)
|
||
| 2017-01-07 04:05 – 05:35 | r61 – r225 | |
顯示 diff 研究筆記-LightBlue Bean+
+ *
+ 緣起
+ 很久以前看這個板子的介紹就很喜歡,主要是可以透過 藍芽升級 Arduino code.年前為了免運,順便敗了這個。
+
+ Learn Check List
+ *Setup
+ *Program
+ *Run most sample codes
+ *Run demo mobile App
+ *iBeacon checked
Hint
Cannot find bean’s serial port in Arduino IDE
*To work around: cat /tmp/cu.LightBlue-Bean
+
+ Battery Status
+ *Refer Battery Functions
+ The current battery voltage is: 3.05V
+ The remaining battery life is: %70
+
參考
+ *PunchThrough LightBlue Bean+
*LightBlue Bean+
*Get Started
+ *Arduino code reference
|
||
| 2017-01-07 01:43 – 01:43 | r13 – r60 | |
顯示 diff 研究筆記-LightBlue Bean+
-
+ Hint
+ Cannot find bean’s serial port in Arduino IDE
+ *To work around: cat /tmp/cu.LightBlue-Bean
參考
*LightBlue Bean+
(1 行未修改)
|
||
| 2017-01-07 00:31 – 00:33 | r3 – r12 | |
顯示 diff 研究筆記-LightBlue Bean+
+
參考
+ *LightBlue Bean+
+ *Get Started
|
||
| 2017-01-07 00:31 | r2 | |
顯示 diff(3 行未修改)
|
||
| 2017-01-07 00:31 | r1 | |
顯示 diff 研究筆記-LightBlue Bean+
+
+ 參考
|
||
| 2017-01-07 00:31 | r0 | |
顯示 diff-
+ 研究筆記-LightBlue Bean+
|
||