During this workshop, you will start from a p5.js starter template. and hook it up to receive IMU data.
Goals:
console.log
to inspect data.In this section, you will create a project folder on your disk that includes the index.html and sketch.js files that you need in order to a run a p5 sketch. (These are similar steps to the ones you used in the workshop Setting up an IMU, except that you've already set up Visual Studio code.)
cd
to change an existing terminal window to the directory in which you want to create the new project folder; for example, just cd
to move the terminal to your home direcgtory.)git clone <https://github.com/osteele/p5-module-template.git> imu-workshop
. This creates a local folder named imu-workshop
, that has the files for a minimal p5.js sketch.imu-workshop
folder.sketch.js
so that something appears on the screen.We will use the imu-tools npm package to subscribe to IMU data that is coming from the network. This involves adding the imu-tools npm package to our project, so that we can write code that calls functions in this library; and specifying the connection address of a network server.
Note: You will need to add lines to both index.html
and sketch.js