top of page

Object

A design blog

Lab 4: P5 Serial Communications with Arduino + Animation

  • Writer: Summer Thompson
    Summer Thompson
  • Nov 5, 2018
  • 1 min read

Intro:

The following circuits and Javascript program were created for the fourth lab assignment for the 2018 Object class at the Atlas institute at the University of Colorado, Boulder. The objective of this lab was to explore serial communication between Arduino and P5, then use P5 to build a human interface between analog input from a user and a visual display.

Materials:

Procedure:


I began with Analog Input, using two analog pins to read potentiometers on the breadboard. I then wrote this code to print the input to the serial monitor. Once I had that up and running, I opened my P5 Serial Control app and connected to the port my Arduino was attached to. Then I adapted this base template code created by Arielle Hein, to read in my input and display an animation that responds to the input from the potentiometers. I created an animated flower that moves horizontally and increases flower petals number, based on input from each potentiometer. Here's the edited code I used. And heres a video:


Conclusion:

This lab was challenging but really opened my eyes to the potential of using Arduino as with JavaScript. I can see using this base code to as a start to a full game with p5 of an animated frogs eating falling flowers. I can also see how the switches can be used to build convenient game controllers. Even though I had quite a bit of technical difficulty in this lab, really any machine can do this. Thanks for reading!

 
 
 

Comments


  • github
  • Black YouTube Icon
  • Black Pinterest Icon
  • Black Instagram Icon
bottom of page