Pcomp - week 6

Lab: Intro to Asynchronous Serial Communications

For this lab, I connect my breadboard with the arduino board as shown in the schematic diagram, but the reading is either 1 or 0 when not pressing (which supposed to be 0 when not pressing) and showing 0 when pressing (which supposed to be 1when pressed).

  • FIX: add and extra power wire before the switch and move the wire connect to D2 in between resistor and switch.

  • Also the pushbutton I got on the floor, the two legs next to each other are connected instead of the two legs on the opposite side.

  • Note: error: stray '357' in program (cause my keyboard language changed) fixed by repasting the code and deleting the space typed in other language keyboard

Lab: Intro to Asynchronous Serial Communications

  • For this lab, I keep seeing the sensor value: undefine. Then I realized that I have to include the callbacks the function setup().

  • For the second lab draw a graph with the sensor values, I did not removed the backgound color, so the graph did not show up.(video below)

  • For “Reading Serial Data as a String”, my result came out with a lot of small gaps. I am wondering what is that and what is happening.

Lab: Lab: Serial output from P5.js

  • For this lab, I am not sure if it was the problem of the LED or the connection, I did not get the result I want for keyPressed() and mouseDragged(). The value was keep jumping in between 10-54. And I reconnect p5.js and arduino for serveral times and it finally work.

  • For the 72/76 result when program P6.js for serial communication pressing “H“ and “L“, I assume that it is because the ASCII code for H and I is 72 and 76.

Previous
Previous

Pcomp - week 7 & Project 2 thoughts

Next
Next

Pcomp - week4 - Pianola