top of page
Writer's pictureliraz primo

Week 7 - Two-Way (Duplex) Serial Communication Using An Arduino and P5.js

After learning how to communicate between the Arduibo and p5, I started this week's lab by preparing the breadboard with a pushbutton, potentiometer and a sensor.



Then, I checked to code to see in the serial monitor what are the accelerometer values

After seeing the values and that the sensors works, I open the p5 serial control and saw that there is a connection with the Arduino



Once I opened the p5 web editor to connect the webstock with the serial port, I could not see the port list. I made sure that my code is well written and that I use the right name of the Arduino that appears in p5 serial control but nothing happens, I saw a ball but I could not control it, and there wasn't a connection to the Arduino.



Thanks to a friend, that asked me whether I work in Safari or Chrome, I realize that I open the p5 web editor in the Safari, and then like magic when I open my sketch in Google Chrome it worked. There was a different in the movement of the rect between the sensor and the potentiometer, and when I pressed the button the rect disappeared.






Project 2 - smart knitting needles

Now, that winter is around the corner, as always I love to knit my scarfs with two knitting needles. This weekend while I am in action, I realize that I have to come up with a system to control the counting of my loops. I would also like to use some sort of a music control that could sense when I am knitting and when I am not, and then play music according to that.


While knitting, I thought about the action of the two needles - one touching each other, there is already a system of how to control a circuit - the touch of the needle could be a switch.


In one of my ICM assignments, I created a code that draws loops, each loop appears as you presse on the mouse, so what if I can connect the p5 to the Arduino to the needles? Every time when I am knitting a loop, I can see it on the screen synching with the p5.

As I teach knitting, and with this pandemic it could be a system for me to see how my students are dealing with their creations. Seeing their mistakes, to have an online option to see physical fabrics in two dimensional on my screen, that could be amazing. There could be different sounds for right and left loops too.














74 views0 comments

Recent Posts

See All

Comments


bottom of page