|
Re: Automatic limit switch
To stop a motor at a certain speed, that is a job for encoders. Encoders track the number of rotations of a shaft which you can use to compute the speed.
You could use a limit switch to stop a motor when the motor reaches a certain position, assuming that the motor turns some armature which physically turns the switch off.
The code for this in java would look like this:
DigitalInput limitSwitch = new DigitalInput(3); The constructor argument is the port its plugged into on the io board.
Then to get a Boolean value of weather it is closed or not use limitSwitch.get();
Good Luck!
__________________
Computers run on smoke. When you let the smoke out the computer stops working.
|