top of page

Object: Basic Game

Task: Build a game which uses serial communication between Arduino and P5JS

Time Frame: October 2019

Course: Object

Summary: Ideation, Fabrication, and Playtesting


The first part of the lab was to send serial data to P5JS from Arduino. I decided to created a setup with a potentiometer and a slider which controlled the width and height of an ellipse on the P5JS display. The video shows this function.

The second part of the lab was to create a game using the P5JS interface and serial communication back and forth from the Arduino. I created a basic game where a random sized red ellipse is created. Then, the user has to use the potentiometer and slider to match their green ellipse to the red one. Once they match the size (+/- 5 to allow for human error), then serial communication is sent to the Arduino which turns the yellow LED on. The first video for this shows the user playing the game. The second video shows random red ellipses being generated along with some game play.

The code on the bottom left is for P5JS and the code on the bottom right is for the Arduino. Schematics are also included in the gallery to the left.

bottom of page