🛠️ Two-Way (Duplex) Serial Communication Using An Arduino and P5.js

Punctuation

https://vimeo.com/639315530

Setup and test on Aruido when not connecting to p5.js.

Connecting to p5.js

截屏2021-10-25 下午5.00.30.png

截屏2021-10-25 下午4.59.25.png

Then I open the serial control and the p5 web editor to make the connection between Arduino and P5.js. In the p5 sketch, I changed back the functions regarding the server connection status to console.log, letting the status appear in the console tab.

https://vimeo.com/639317043

As shown in the video, I can control the location of the white ball using the potentiometer. The ball's color will ideally change when I press the button, but now it is not so obvious.

Flow Control: Call and Response (Handshaking)

截屏2021-10-25 下午5.10.06.png

Code for Arduino for the handshaking part.

https://vimeo.com/639319748

Testing on Arduino only without p5 connection. When opening the idle, text "hello" appears repeatedly. The data can be accessed when typing something in the textbox.