For my lab 5 project I used the gesture sensor from my previous project to send data to p5 using asynchronous serial communication. This involved printing data to the serial port, then using the p5serialcontol app to send data to the p5 web editor, then using that data to draw shapes on the screen. My program moves a white ellipse around a blue screen corresponding to the x and z position read by the gesture sensor.
My circuit diagram is the same as in my last project, but with only the gesture sensor hooked up, no LEDs this time. The Fritzing diagram is shown to the right:
Here is a link to my code, both the Arduino and P5:
https://gist.github.com/jackplantz/31879532c94839ded8481a987bf01412
And here's a video showing how it works!
Comments