Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a program that controls a motor [closed]

Connecting a motor to move a laser pointer up/down left/right to draw patterns.

Has anyone seen any examples to help the project? What programming language would be used for this? What computer ports would this use? Does a custom circuit have to be made or does a store exist for this?

like image 460
Gunslinger Avatar asked Nov 05 '22 02:11

Gunslinger


1 Answers

There is a lot of different approaches you could go to this. Here is a few off the top of my head.
1. You could use a micro controller like an Arduino.
2. You could use a serial port and a socket. Here would be a good resource if you want to pursue this route. http://www.easysw.com/~mike/serial/serial.html
3. If you only need to control two motors you could use the headphone jack on your computer. You could hook a simple amplifier circuit up to each of the left and right speaker line. Then hook each of the amplifiers up to a separate motor. Then you could write a program that generates a separate sound for each channel, thus modifying the voltage given to each motor.

P.S if you use a servo, you can control the exact angle of the laser.

like image 107
Skyler Saleh Avatar answered Nov 09 '22 12:11

Skyler Saleh