Posts

Showing posts from November, 2019

Final Project Proposal

Image
Working title: Trio Tiro is a sound piece company by a visual projection using  an analog sensor and P5 sketch . By using the ultrasonic module distance sensor I want to program three trigger  point to activate three different sounds or voices to make a melodious music. The project is hope experiment  with an analog sensor reacts to P5 sketch program that communicate to an arduino.

P5.js to Arduino

Image
task: Make something move, light up, or change in the physical world using output from a P5.js sketch. my first attempt failed. My p5 didn't responded.  I realized that I had the p5 code wrong so it worked once I ran the right coding. // WORKS IN CHROME // variable to hold an instance of the serialport library let serial; // !! fill in your serial port name here let portName = '/dev/tty.usbmodem24'; // for incoming serial data let inData;                        // for outgoing data let outByte = 0;                      function setup() {  createCanvas(400, 300); // make the canvas  // make a new instance of the serialport library  serial = new p5.SerialPort();   // callback for when new data arrives  serial.on('data', serialEvent);   // callback for errors  serial.on('error', serialError);  // open a serial port  serial.open(portName);          } function serialEvent() {  // read a byte from the serial port:

Motors

Image
To Do : Make something move. Try to use an analog sensor. Here is my schematic:  Connect power and ground on the breadboard to power and ground from the microcontroller. On the Arduino module, use the 5V or 3.3V (depending on your model) and any of the ground connections, as shown in Figures 9 and 10. Program the Microcontroller First, find out the range of your sensor by using analogRead() to read the sensor and printing out the results. And my motor worked: