@Robin put up a good link for detecting double-clicks. While it's not that hard, it's trivial to detect long vs short clicks, so you could always just do that?
I reckon the bluetooth flag tutorial you found is a good place to start. The initial example (using UART) uses ble_simple_uart - which abstracts away so much that you can't connect separately.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi!
@Robin put up a good link for detecting double-clicks. While it's not that hard, it's trivial to detect long vs short clicks, so you could always just do that?
I reckon the bluetooth flag tutorial you found is a good place to start. The initial example (using UART) uses
ble_simple_uart
- which abstracts away so much that you can't connect separately.However you could just use the
ble_uart
module referenced at https://www.espruino.com/BLE+UARTSo the receiver stays exactly as-is on http://www.espruino.com/BLE+Communications#receiver-bluetooth-peripheral-device-
Then for the transmitter
The page with the flag example had another option too (using custom characteristics): http://www.espruino.com/BLE+Communications#sending-commands-custom-service-
Working with that is basically the same - you just use
device.gatt.connect()
rather thanrequire("ble_uart").connect(device)