Skip to content

A convenient setup for researchers and learners that allows one to interact directly with their microcontroller in a web browser

License

Notifications You must be signed in to change notification settings

almonds0166/6302view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

6302view

6302view is a setup that allows researchers and learners to interact directly with their microcontroller in a web browser. Used in MIT subject 6.302 (Feedback system design).

Our goal of this project is to make it elegant -- just include the library and go -- no explicit need to modify anything depending on the microcontroller, for example.

(system setup)

Supported microcontrollers

Quick example

#include <Six302.h>

// microseconds
#define STEP_TIME 5000
#define REPORT_TIME 50000

CommManager cm(STEP_TIME, REPORT_TIME);

float input;
float output;

void setup() {
   /* Add modules */
   cm.addSlider(&input, "Input", 0, 5, 0.01);
   cm.addPlot(&output, "Output", -1, 26);

   /* Ready to communicate over serial */
   cm.connect(&Serial, 115200);
}

void loop() {
   output = input * input;
   cm.step();
}

The above creates a Slider called "Input" from 0 to 5 (at a step size of 0.01) and a Plot called "Output" from -1 to 26, illustrating the square of the slider input:

(gif of resulting modules)

The system loops at once per 5000 µs (5 ms), and data is reported once per 50000 µs (50 ms).

Quick install

  1. Download this repo and extract the contents to an unzipped folder.

  2. Copy the inner 6302view/ folder that contains the C/C++ library to your Arduino libraries folder.

  3. Install the Python dependencies websockets and pyserial using pip.

To run the local server, run local_server.py, located in gui/, with a Python version of at least 3.8. Finally, open gui.html in your favorite web browser.

Dependencies

Python modules used

Only required if using local_server.py for communication over Serial.

websockets
pyserial

Arduino libraries used

Only required if you want to use the WiFi modules of ESP8266 or ESP32 as opposed to communication over Serial.

Go to Manage libraries... and search for WebSockets. It's the one at the bottom by Markus Sattler.

Documentation

Documentation is in docs.md!

About

A convenient setup for researchers and learners that allows one to interact directly with their microcontroller in a web browser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published