Ask Your Question

ros_serial, arduino, lights on/off with variable delay

asked 2012-04-02 13:44:22 -0500

matt2027 gravatar image

updated 2012-07-02 13:41:28 -0500

mjcarroll gravatar image

Hi, I was wondering about a project that I wanted to use ROS in a dispensing setup. I have a Python code setup running the pocketsphinx for voice recognition. Everything is working there, I am publishing command words. I know the next step is to create a python code that monitors the command topic and then publishes that to the arduino over ros_serial. I may have over looked it, but I haven't seen much on that step.

In relative terms this seems pretty easy. I just want to be able to turn a 5v solenoid on for a variable amount of time. I say what solenoid and then the amount of time. Then that info is sent to the arduino. So I was thinking it sounded a lot like the blinking light on the ros_serial tutorial as I was going through it. The thing that got me was how to load a variable number into a variable delay timer. I want the solenoid to stay on, not blink. Where would I set the delay, right after each callback or in void_loop? I thought that I could give each CallBack its own identifier and thats how I would identify the solenoids, I don't know if thats right or not.

If anybody knows a direction to look, that would be great.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-04-02 14:38:09 -0500

Kevin gravatar image

Please go through the tutorials ... take a look at publish/subscribers for python that should be what you want. Also please try to make your questions clear and only one question per post so we can mark them closed when answered ... I was not sure what you were asking.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-04-02 13:44:22 -0500

Seen: 450 times

Last updated: Apr 02 '12