• Skip to main content
  • Skip to primary sidebar

Celia's Documentation Blog

NYU Shanghai IMA

Recitation 9: Serial Communication by Celia Forster

April 28, 2021 by Celia Forster Leave a Comment

In this recitation, I used the code resources provided in the serial communication folder. The first exercise was to create an Etch a Sketch by sending the Arduino values from two potentiometers to Processing. While it was rather simple to do this with a circle, I wanted a smoother line to make it as close to a real Etch a Sketch as possible. After doing some research online for reference code, I learned that in order to get the line function to work properly, I had to set up variables for a previous X and Y. The video of it working properly is shown below:

https://wp.nyu.edu/nyushanghai-celiaforster/wp-content/uploads/sites/19366/2021/04/serial_AtoP_processing_rec-2021-04-23-14-28-37.mp4
A schematic of this circuit

The second exercise in this recitation was to make the Arduino control servo motors on each side of the computer screen, where a ball moves from one side to the other. Creating the code to move the ball from one side of the screen to the other was rather simple. However, I met difficulty in making the servo motors act according to the code. One of the motors kept vibrating rather than moving at the 90-degree angle my code directed it to do. As it turns out, this was due to an issue with the delay. Once I added a delay, it moved properly. The result was not perfect, but due to time constraints, I was unable to make the movement of the motors smoother, but the result is shown below:

https://wp.nyu.edu/nyushanghai-celiaforster/wp-content/uploads/sites/19366/2021/04/WeChat_20210425214822.mp4
A schematic of this circuit

Homework

The homework for this recitation was to make a circuit that has two buttons and make them interact with the code in Processing to make rotating shapes appear and disappear by pressing the buttons. I first set up the buttons on my breadboard and wrote the code to produce the rotating shapes in Processing. I decided to make these components separate initially to ensure that both sides of the project were working properly. Connecting the two proved to be much more difficult, as I was able to get the shapes to appear for the duration of the button being pressed down, but coding it to be a toggle switch was harder than I had expected. I finally got it to work properly after using a combination of if-statements and while-loops. It is intermittent at times, but I consider it to be mostly a success. A video of this project is shown below:

https://wp.nyu.edu/nyushanghai-celiaforster/wp-content/uploads/sites/19366/2021/04/WeChat_20210425214852-1.mp4
A schematic of this circuit

Filed Under: Interaction Lab

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Archive

Course

  • After Us: Posthuman Media (6)
  • Communications Lab (14)
  • Interaction Lab (22)
  • Working with Electrons (9)

Recent Posts

  • Final Project PART FOUR: Documentation May 16, 2021
  • Final Project: Individual Reflection May 16, 2021
  • 05.04.2021 In-Class Exercise: Pixels! May 5, 2021
  • Interaction Lab Final Project: Progress Entry #1 May 5, 2021
  • Final Project: Progress Entry #2 May 5, 2021

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2025 · News Pro on Genesis Framework · WordPress · Log in