PCOM – Week 06

  • Serial Input to p5.js

It took a enormous amount of time to connect the p5.serialport app to the p5 sketch. The error that I have kept ‘ the constructor is not defined’ in p5. The problem was to properly put
this file
into the html file of my p5 sketch. The error kept going on and on, somehow succeeded and did the serial input Lab experiment. The most important thing to keep in mind during the experiment is the following sequence. If I wanted to fix the arduino code in the middle, I had to close the serial app and start from the beginning in the following order.

  1. arduino code uploaded
  2. p5 serialport app run
  3. p5.js sketch open
    Always keep this order! if not, the works is done anything.

with delay(1)

with delay(100)