-
Notifications
You must be signed in to change notification settings - Fork 13
Installation
To use p5.fab, you can use the p5.js web editor or set up a local installation. The former is the quickest & easiest way to get started; the latter is nice if you already have a preferred text editor or desire more flexibility in your coding environment. If you're unsure, I recommend starting with the Web Editor!
This library relies on WebSerial support, and therefore is only supported on Google Chrome at this time (see Dependencies below).
IMPORTANT: If you're using the p5.js Web Editor, be sure to sign up or log in before continuing so that you can save your progress. If you sign up or log in later on, you will lose previous progress!
Add a new file to the web editor by opening the Sketch Files Dropdown Menu on the left-hand side, and then selecting Create File; we suggest naming the file p5.fab.js. Copy-paste the contents of the p5.fab.js library file. Navigate to index.html and add the path to your new file to the <head>
tag:
<script src="p5.fab.js"></script>
Download the p5.fab.js library file and add the path to the <head>
tag of your index.html file:
<script src="p5.fab.js"></script>
Note that you will need to run a local server as well.
This library relies on serial communication for your printer and p5 to talk. The easiest option is to use p5.WebSerial, which will only work in the Chrome Browser. Regardless of your installation choice, add the following line to the <head>
tag of your index.html file to use p5.WebSerial:
<script src="https://unpkg.com/p5-webserial@0.1.1/build/p5.webserial.js"></script>