Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpiozero.Servo() and OutputDevice(8) import or usage error??? #18

Open
OpenSourceIronman opened this issue Jul 12, 2020 · 1 comment
Open
Assignees
Labels
help wanted Extra attention is needed

Comments

@OpenSourceIronman
Copy link
Contributor

https://gpiozero.readthedocs.io/en/stable/api_output.html#servo

Blazes-MacBook-Pro:v2020.0 blazesanders$ python3 Driver.py
DEBUG STATEMENTS ARE ON INSIDE Actuator.py CLASS
Actuator.py MESSAGE: WARNING: You are running code on Mac or PC (NOT a Raspberry Pi 4), thus hardware control is not possible.

DEBUG STATEMENTS ARE ON INSIDE Try/Catch ImportError in LASER.py CLASS
Try/Catch ImportError in LASER.py MESSAGE: WARNING - You are running code on Mac or PC (NOT a Raspberry Pi 4), thus hardware control is not possible.

DEBUG STATEMENTS ARE ON INSIDE Driver.py CLASS
DEBUG STATEMENTS ARE ON INSIDE Actuator.py CLASS
Traceback (most recent call last):
File "Driver.py", line 414, in
fluidActuatorList = [Actuator('R', RUM_PUMP, rumFlavorPins, "Rum Flavor Motor: Zjchao 202", Actuator.CW)]
File "/Users/blazesanders/Tapomatic/v2020.0/Actuator.py", line 143, in init
tempServoObject = Servo(pins[0]) #TODO REMOVE BECAUSE TO SIMPLE AN OBJECT
NameError: name 'Servo' is not defined

@OpenSourceIronman OpenSourceIronman added the help wanted Extra attention is needed label Jul 12, 2020
@OpenSourceIronman OpenSourceIronman changed the title gpiozero.Servo() import or usage error??? gpiozero.Servo() and OutputDevice(8) import or usage error??? Jul 12, 2020
@OpenSourceIronman
Copy link
Contributor Author

pi@raspberrypi:~/Tapomatic/v2020.0 $ python3 Actuator.py
DEBUG STATEMENTS ARE ON INSIDE Actuator.py CLASS
Actuator.py MESSAGE: Try fail in main of Actuator.py

After changing the code to the following to get the output at bottom of this comment.

  1. So what line is causing try fail?
  2. Is "except NameError:" too vague and catching ALL exceptions?

283 try:
284 #Actuator.UnitTest()
285 #relay = OutputDevice(8) #BCM-8
286 #relay.on()
287 #time.sleep(20) # seconds or milliseconds?
288 #relay.off()
289 print("THIS CANT FAIL?")
290 v
291 currentProgramFilename = os.path.basename(file)
292 NameDebugObject = Debug(True, currentProgramFilename)
293 NameDebugObject.Dprint("Try fail in main of " + str(currentProgramFilename))
294
295 print("END ACTUATOR.PY MAIN")

END ACTUATOR.PY MAIN
pi@raspberrypi:~/Tapomatic/v2020.0 $ python3 Actuator.py
THIS CANT FAIL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants