🙋🏼 Before starting, please connect an Arduino Board with Mini GaussSense and upload the Arduino firmware to the board 👉🏼 Head First Mini GaussSense.
Please set up your GaussSense Desktop and Mini GaussSense following First Steps with GaussSense Desktop
After connecting Mini GaussSense, GaussSense Desktop would start a WebSocket server (port:
5100) to send the sensor data.
Simply include GaussSense.js in <body></body> to receive data from Mini GaussSense.
Then use the
var gs = new GaussSense();
After that, let's start a new project or explore a lot of web projects on 👉 GaussSense Playground
Live Demo on JS Bin: Example using GaussSense.js and p5.js
A p5.js project contains two main functions:
setup() block runs once, and is typically used for initialization. The
draw() block runs repeatedly to refresh the canvas element, and is used for animation.
We could access the north/south point and the bipolar midpoint of Mini GaussSense with a GaussSense object.
|Get the north point object. Attributes: x , y , intensity|
|Get the south point object. Attributes: x , y , intensity|
|Get the bipolar midpoint object. Attributes: x, y, intensity, angle, pitch|
x and y lies within the interval [0, 1] and would be -1 when the intensity of magnetic field is 0.Back to Tutorials