Week 7 Lab
October 27, 2020
Two-Way (Duplex) Serial Communication Using An Arduino and P5.js
This lab was pretty simple to follow but I ran into small errors throughout the way. Since I was using the on board accelerometer I had to modify the startup on the Adrduino:
void setup() {
Serial.begin(9600);
// for on board arduino accelermeter
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
if (!IMU.begin()) {
Serial.println("Failed to initialize IMU!");
while (true); // halt program
}
Serial.println("IMU initialized!");
// configure the digital input:
pinMode(buttonPin, INPUT_PULLDOWN);
while (Serial.available() <= 0) {
Serial.println("hello");
delay(300);
}
}
I also was running into issues connecting to the localhost and it was not connecting.
I don’t think I figured this out quite yet. I still had issues that I had yet to debug and will have questions in class about.
here is my quiz from the week.
a blog by sam heckle class of itp 2022. doing shit. twitter.