Physcomp: project 

︎︎︎Intro to Asynchronous Serial Communications




Serial.println:
6-bit, range from 0-1023. Those returned numbers are ASCII encoded-decimals.





Serial.write:
10-bit, raw data. Those returned numbers are ASCII characters.





ASCII Table: This sketch is printing the raw binary value, then the ASCII-encoded binary value, then the ASCII-encoded decimal, hexadecimal, and octal values.





Flow Control: Call and Response (Hamdshaking), the program is only started to send when I told it to do so.






︎︎︎Serial Input to P5JS





Program the Microcontroller



Connecting to P5JS throught P5 Seriel  Control:





Serial Event with Drop Down Menu: When I first run the P5, I can se the sensor reading on the canvas changing, but when I rerun it, its started to show undefined. Tried several times but still not working. P5JS Code Link





Graph with the Sensor Value: Same thing happened when I run this code, but for this one, it work and not working randomly.  P5JS Code Link






︎︎︎Serial Output to P5JS





Program the Microcontroller:





MouseDragged the P5JS to Control the LED: It suppossed to be As I drag the mouse, the position value in the p5 will be transferred to LED and change its brightness accordingly. However, it wont work on my conputer, when I typed the same code on my friends computer, it worked very well. Same thing happened on the Key Pressed.  P5JS Code Link









Key Pressed the P5JS to Control the LED: P5JS Code Link