I am using Jasper.
The voice control part works, however the function I call when a certain word is said, does not.
I'm trying to control a robot, sending high signals to certain pins on an L293D chip. I've made a simple function to easily set multiple pins high:
import wiringpi2 as wiringPi wiringPi.wiringPiSetupSys() def goHigh(*arg): #for multiple pins for pin in arg: wiringPi.digitalWrite(pin, 1)
But when I call that function with a certain word, I get the error
NameError: global name 'wiringPi' is not defined:
ERROR:client.brain:Failed to execute module Traceback (most recent call last): File "/home/pi/jasper/boot/../client/brain.py", line 73, in query module.handle(text, self.mic, self.profile) File "/home/pi/jasper/client/modules/robot.py", line 64, in handle goForward(mic, message) File "/home/pi/jasper/client/modules/robot.py", line 29, in goForward goHigh(A1,B2) File "/home/pi/jasper/client/modules/robot.py", line 12, in goHigh wiringPi.digitalWrite(pin, 1) NameError: global name 'wiringPi' is not defined
It seems that Jasper cannot see WiringPi as being installed. What I've tried:
- Building WiringPi in the Jasper directory
- Normally building it in my
But this still doesn't work; I presume because WiringPi builds in its own folder, and Jasper looks for a single file.
How can I fix this? So I can use WiringPi with Jasper?