This week assignement is interfacing with input and/or output devices , I write an interfacing program on processing to draw input potentiometer value and an according output motor values: motor state (running/stop), motor direction, motor speed percentage on computer screen. In arduino code I read potentiometer value, adapt motor state, speed, and direction , track changing I/O values and send to serial port in order to show them on processing. In processing code I read Input string from serial port split and processed with fuctions then draw I/O values: potentiometer input value, motor state: stopped or running according to the value of potentiometer if greater than threshold value of 500 it's running otherwise its stopped, direction is always forward, speed percentage is calculated in the program and shown in result. see please the screenshot results and program files.
arduino IDE extract of code.
processing extract of code.
results on videos
To download arduino and processing codes.
here is the arduino code
here is the processing code