Created
March 22, 2018 15:24
-
-
Save Mango-kid/48efa955144af9639bdea5885c4803a5 to your computer and use it in GitHub Desktop.
Using the limt switch manually.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
the example uses the move command and the manual limit switch check command. It moves the motor and then checks the limit switch. | |
this can be used to do fine manual homing | |
''' | |
import Slush | |
#setup the motor | |
b = Slush.sBoard() | |
m = Slush.Motor(1) | |
m.resetDev() | |
m.setLimitHardStop(0) | |
m.setCurrent(50, 50, 50, 50) | |
m.setMaxSpeed(100) | |
#move until the limit switch is pressed | |
while m.getSwitch(): | |
m.move(100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment