Puck.JS connection to MDBT42Q and simple click function #3288
Replies: 7 comments
-
|
Posted at 2020-02-06 by Robin Wed 2020.02.05
Ahhh, @user108865 a "Do, Think, Do" individual. . . . Here are some "Think, Do, Think" examples . . . .
Code snippets for detecting a double click > [One or double click the button and time duration for long or short press?](http://forum.espruino.com/conversations/273190/) |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-06 by @gfwilliams 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 However you could just use the So 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 |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-06 by psc1988 Ok thank you I got it. One thing is strange at the MDBT42Q. Any ideas? |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-06 by @gfwilliams Ahh... Try changing to I guess you have the original firmware on the MDBT42Q? There was an issue where if Espruino tried to print data over BLE but nothing was reading it (as could be the case here?) it'd get stuck. It got fixed some time ago but was just after the 2v04 release, so only 2v05 and later (which haven't been released yet) will have it |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-08 by psc1988 Hi Gordon, with the code above it works without your modification in your last post. I think my code I used before had an issue. I will try to find out. Thank you very much! |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-12 by psc1988 Hi Gordon, the program works great. I use also a force sensing resistor, I want to buit into the Puck.js. The the outputs (Jack connectors), I designed a PCB with the same size of the MDBT42Q and I will connect it like a sandwich furthermore with another PCB (same size) with the same battery + socket from the Puck as power supply. If this works it would be a great product. Regarding CE-Certification on Puck and MDBT42Q its much easier to certify as a medical product because of these references. It could be a great benefit for many users to have a wireless button. Thank you again for the informations. Best regards |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-13 by @gfwilliams Great! Glad it's working well for you. Removing the battery and re-applying will lose code if you had it just saved to RAM. All you need to do is move to saving to flash - check out http://www.espruino.com/Saving for an example. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-02-05 by psc1988
Hi,
I am new in programming via Javascript. I have a Puck.JS and a MDBT42Q and I wanna do a connection with Bluetooth and the following function:
If both devices powered up they should connect to each other automatically. Then the simple function, when I do a click with the Puck I will switch a digital output to high and turn on the led for maybe 0,5sec at MDBT42Q and on the Puck.
Is there also a possibility to detect double clicks?
I tried the tutorial with the servo/flag but the pairing starts when I push the button right? Thats why there is a delay for the incoming signal on the MDBT42Q.
Can you help me? I am a person for learning by doing but I got not forward here.
Greetings
Beta Was this translation helpful? Give feedback.
All reactions