Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

P5.js as a web-based language that can be used with Arduino to allow a fast exchange of information between Arduino and a website. It is the officially supported JavaScript-based library for Processing and renders natively to the Canvas element. P5.js implementation has a very similar API as Processing, despite being written in JavaScript and not Java.

...

If everything works you are (almost) set! 🔥

BE CAREFUL! If you have Serial port monitor open the connection is going to break up.

To write code in p5.js we will use Processing, with p5.js mode enabled. Running the sketch opens a live server directly in the browser.

An index.html file is created in each new sketch folder. It contains a section where each .js file from the sketch is added automatically. Removing this block of code (it’s clearly marked in the file) will cause the sketch to no longer run inside the PDE.

Add library files or additional code to the libraries subfolder of the sketch. References to that code will automatically be added to the HTML file, though the libraries won’t be visible as tabs in the Editor.

...