RF24: An advanced example for the Arduino Uno Q
A new take on the RF24 GettingStarted example
In testing out the RF24 library and related features, I managed to get a few different things working together on the Arduino Uno Q to provide a more advanced example of RF24 interaction.
The main thing the sketch does is transfer data over RF24 radio link along with a standard Arduino device running the RF24 GettingStarted sketch included with the RF24 library.
Then, any data received is displayed in the Serial Monitor, Python Console and an associated webpage to demonstrate usage of incoming data etc.
A button is included on the webpage that allows users to toggle the LED matrix on/off, which demonstrates how to pass data from Webpage to Python to Microcontroller.
All in all its a simple concept, but it did take some figuring to work out how the functions and stuff all relate through JavaScript, HTML, Python, C++ etc.
My Arduino Q sketches can all be found here:
https://github.com/TMRh20/Sketches/tree/master/ArduinoQ
For a limited time, a live real-time demo of a similar sketch will be available online here:
The main functionality is tied into 4 files:
sketch/sketch.ino - The Arduino sketch handles radio input/output & passes its data to Python
python/main.py - The middleman between the webserver and the Arduino sketch
assets/app.js - JavaScript handling, communicates between index.html and Python via websockets
assets/index.html - The main webpage, provides variables that can be modified via JavaScript
No comments:
Post a Comment