RECENT WORK ︎︎︎

ITP BLOG ︎︎︎

ABOUT ︎︎︎

crandall.lily@gmail.com

@dullhouze



WEEK 8


Lab: Intro to Asynchronous Serial Communications

This lab took me a while to set up. First of all, I was using a brand new Arduino Nano because my original one broke while working on the midterm. I plugged it in, typed in a very simple program, and received this error message:

signal: killed
Compilation error: signal: killed

I had never seen this before, and was worried there was something wrong with my brand new board. I rewrote the code a few times and was ready to give up, when a resident suggested restarting Arduino IDE. That did the trick.

The next problem I ran into was in the Terminal - I couldn’t open the screen program. I had to first download MacPorts for my laptop’s operating system (wait a while for that to install), then enter a source code to install screen, and then open it.  On the left is the error message I kept getting until I realized I had to install the screen program. When I finally got it to work, I could see the sensor values scrolling quickly.

From then out it was fairly simple for this lab, I was able to successfully show values for the potentiometers in a way that made sense to read. Below shows the value for each potentiometer individually, separated by a comma. 


Then I added the button value into the line. Below I show the third part of each line changing from zero to 1 when I press down on the button.



testing Serial.println :






Lab: Serial Input to p5.js Using the p5.webserial Library

Then it was time to open a p5 sketch. I thought it was pretty cool to be able to program a pop up button. I used Chrome, which I knew would work, so I added an }else{ statement that said “all good!” if the person uses a suitable browser: 


I was able to successfully import the data coming through the Arduino into my p5 sketch:

   

I ran into issues when I got to the part about reading serial data as a string. I kept getting error messages when I ran the code. I tried debugging for a bit but couldn’t figure it out.