Montag, 13. April 2015

Motor Labs

Controlling a Servo Motor from Processing



This is a video of me controlling the servo from Processing. The source code was taken from class so I won't post it here. However, it can be found here: http://cs.nyu.edu/~amos/courses/physical_computing/arduino-platform/controlling-a-servo-motor-from-a-processing-program_03042013.html


Controlling a DC motor with a Potentiometer



Here a DC motor is controlled by a potentiometer.  The source code is here:

The Arduino reads the analog input from the potentiometer which then is mapped to match the 0 to 255 of the DC motor. After, the pot value is sent to the DC motor and the speed is controlled.


Control the speed of a toy motor from processing

It is kinda hard to see here that the DC motor is moving but it is (you see it shake at 0:03 when it turns on). The code for this task was a mix of the above two. I used the processing code from the first one and removed the potentiometer from the second one and replaced it with serial communication. The arduino code is below: