-
-
Hello Gordon,
I have successfully set up the puck.js to control Music player via BLE as your cool project available at
https://www.espruino.com/BLE+Music+Control
I would like to now do the same thing with an external button attached to the puck.
In another forum post, you said this was possible using the methods here:
http://www.espruino.com/Button
I see that I can connect the external switch between to io buttons (e.g. A6 and B1) and that I dont need to use an external resistor for this.
I am unsure of the code to use. Do I just paste your two sets of code together (as I have done below - is it correct)? Or do I need to change some of the BTN lines?
Thanks very much for your help...
Gene
digitalWrite(A6, 1); pinMode(B1, 'input_pulldown'); setWatch(function(e) { console.log("Button pressed"); }, BTN, { repeat: true, edge: 'rising', debounce: 50 }); // you'll need to use edge: 'falling' if you connected the button to 0v var controls = require("ble_hid_controls"); NRF.setServices(undefined, { hid : controls.report }); setWatch(function(e) { var len = e.time - e.lastTime; if (len > 0.3) { controls.next(); digitalPulse(LED1,1,100); } else { controls.playpause(); digitalPulse(LED2,1,100); } }, BTN, { edge:"falling",repeat:true,debounce:50});
-
-
-
-
-
-
-
-
-
Gordon, thanks so much for your reply; although I am still tearing my hair out, you're helping me get closer to the root of my problem.
There were some connection issues; I may have addressed those by gathering up the zillions of other bluetooth devices and hiding them away (I am not sure). The issue of the device not really letting go of the bluetooth connection was certainly causing the problem, so I disconnected (OS) and reconnected (WebIDE) and disconnected again after flashing the code. All good so far.
The only problem I have remaining (apart from my apple laptop constantly trying to reconnect to my pucks when I don't want them to) is that when I connect my code-containing puck.js, it will put the letter A in, but it doesn't turn the page in Kindle/iBooks, etc.
So my puck is definitely connected as a keyboard - if I have Mail open it will put aAaAaAaaAAA in a blank message, but if I open Kindle or iBooks, it just won't turn the page.
What have I forgotten? Arghhhh hellppp
Gene
-
Please could someone help: I am tearing my hair out!
I'm a newbie working with puck.js 1.0 and 2.0. I had been able to use this tutorial
https://www.espruino.com/BLE+Keyboard
and the Web ide.
Press the little coffee-cup, Web IDE opens in Chrome, connect, flash the code in and hurrah, yes, it worked :)
But I've spent two days trying to get it to work again, with no joy.
The error code that comes up is
'BLE Connected, queueing BLE restart for later'
One of the variables is that Amazon sent me some DL2032 batteries when I searched for CR2032 batteries. The former are a lot fatter - 3.2mm instead of 2.0mm
Have I busted up my pucks? :'(
I am also finding it a lot harder to connect via bluetooth.
Does it matter if there are too many other bluetooth devices in the house? But it worked before.Any ideas? Please???
I am a big fan of Espruino.
-
-
-
-
[update-all is well. I have some charge. I guess the constant green light is an indicator of charging.]
How do you tell if the watch is charging? My screen is dark, with an empty battery sign in the corner. A constant green light is coming out of the back. Should it be flashing as above, or is all well?
-
-
-
-
-
I couldn't work out how to use Fdroid (all searches came back empty) for my Google Pixel, so I assumed I had the wrong type of OS and I downloaded via Google Play.
Did I do wrong? Is the Google Play version secure? What is the downside of using this version? Haven't had any connectivity problems so far.Very excited about using Bangle.js btw
Awesome and wow thank you! -
Hello @stewartg Does your blind runner know Morse code?
Perfectly! Thank you so much!!! 🙏