Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Okay, I will try to explain this well enough...with what knowledge I have currently.
- # First, I have a MotorBridge.py file. The file consists of line 227 of this file: https://github.com/silver2row/bbg/blob/master/MBC/MotorBridge.py which later entails some ideas on functions related to Stepper Motors.
- # I know it is a class with functions in it, e.g. class MotorBridgeCape:
- # I also know about the file that follows:
- # Mr. Li from Seeed Studio in '15.
- import MotorBridge
- import time
- def StepperMotorATest(): # This function is just made up?
- print ('Hello From MotorBridge')
- motor.StepperMotorAInit() # This is the init function from the MotorBridge.py file/MotorBridgeCape class.
- motor.StepperMotorAMove(1000, 1000) # This is the CW or CCW function
- time.sleep(1)
- motor.StepperMotorAMove(-1000, 1000)
- time.sleep(1)
- #def StepperMotorBTest():
- #print ('Hello From MotorBridge')
- #motor.StepperMotorBInit()
- #motor.StepperMotorBMove(1000, 1000)
- #time.sleep(1)
- #motor.StepperMotorBMove(-1000, 1000)
- #time.sleep(1)
- if __name__=="__main__":
- motor = MotorBridge.MotorBridgeCape() # Is this the only reason that motor.StepperMotorAInit() and motor.StepperMotorAMove() exist?
- # I mean...b/c of me making the motor definition equal the file.class()?
- # For instance, "WHATEVER = MyPyFile.MyClassFromMyPyFile() is why that above source works?
- while True:
- StepperMotorATest()
- #StepperMotorBTest()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement