notes:mqtt
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:mqtt [2024/04/18 20:31] – discord | notes:mqtt [2024/04/20 20:46] (current) – discord | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Written by Jacob Haip on April 17, 2024 | + | ====== MQTT and Microcontroller Folk Integrations ====== |
+ | Jacob Haip, April 2024 | ||
- | I am interested in integrating more physical hardware and sensors into Folk Computer to help expand | + | I am interested in integrating more physical hardware and sensors into Folk Computer to expand |
WiFi-connected microcontrollers are the primary tool I have been using to integrate sensors and actuators with Folk. Boards I have used include the [[https:// | WiFi-connected microcontrollers are the primary tool I have been using to integrate sensors and actuators with Folk. Boards I have used include the [[https:// | ||
Line 74: | Line 75: | ||
===== Getting a button input into Folk ===== | ===== Getting a button input into Folk ===== | ||
- | TODO: GIF of button press. | + | {{micro-button-press.gif}} |
<code c rpi-pico-w-micropython-button-press.py> | <code c rpi-pico-w-micropython-button-press.py> | ||
Line 352: | Line 353: | ||
===== Using MQTT on web pages for bidirectional communication with Folk ===== | ===== Using MQTT on web pages for bidirectional communication with Folk ===== | ||
- | Making simple web pages using the [[https:// | + | Making simple web pages using the [[https:// |
- | + | ||
- | I like these basic web apps as a way to bring phones and laptops into the Folk system as new inputs and outputs. | + | |
First we make a web app that plays a sound when it receives an MQTT messages: | First we make a web app that plays a sound when it receives an MQTT messages: | ||
Line 414: | Line 413: | ||
</ | </ | ||
- | And then in folk you can make every phone and laptop with that web page open play a sound by flipping over a page: | + | And then in folk you can make every phone and laptop with that web page open play a sound when a button is pressed: |
+ | |||
+ | {{button-horse.mp4}} | ||
<code tcl trigger-sound.folk> | <code tcl trigger-sound.folk> | ||
- | set ts [clock milliseconds] | + | When MQTT claims message /message/ topic "/ |
- | Wish MQTT publish "make some noise" on topic "/ | + | Wish $this is labelled " |
+ | set ts [clock milliseconds] | ||
+ | | ||
+ | } | ||
</ | </ |
notes/mqtt.1713472273.txt.gz · Last modified: 2024/04/18 20:31 by discord