-
• #2
Looks great - thanks for posting up!
In some ways, making the Puck a Bluetooth HID device is a lot easier than using Advertising like in http://www.espruino.com/BLE+Advertising - at least it should work with pretty much any computer, without you having to dig around in Bluetooth stuff
Trying to get your Puck bluetooth button to connect to your Raspberry Pi (RPi) to control your projects remotely? Frustrated at how difficult it is to program the button and then get the Raspberry Pi to detect Puck button presses?
Since I spent so many hours trying to figure out how to connect the Puck.js bluetooth button, here's an explanation of how I did it so that you can save time:
Youtube Instructional Video:
https://youtu.be/Vmi1eM2KBsg
Code:
https://github.com/beebowman/EspruinoPuck/tree/main
Wiring Instructions (in code comments):
https://github.com/beebowman/EspruinoPuck/blob/main/EspruinoButtonLED.py
#Wiring instructions:
#1) Attach 5V to the + line on breadboard
#2) Attach GND to the - line on breadboard
#3) Connect pin 16 (GPIO 23) to the pushbutton on side A (one breadboard half)
#4) Connect the same side of pushbutton (side A) to the - of the breadboard
#5) Connect pin 12 (GPIO 18) to the longer side of the LED
#6) Connect longer (positive) side of LED to 220 Ohm resistor, on a second line of breadboard
#7) Connect the other end of resistor to - of the breadboard (GND)
(NOTE: The button wired here is a normal Raspberry Pi breadboard button, and is entirely optional in this case, but can help you troubleshoot to make sure the LED is working properly before trying to connect the Puck.js bluetooth button)
Fritzing Wiring diagram available upon request.
Code below, to upload to your Puck.js button using the Espruino Web IDE interface:
(Note: as a bonus, this code also works to allow your Puck to function as a PowerPoint clicker to press through pages when in presentation mode!)
2 Attachments