Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Newbie Alert! Servo Control with a switch


#1

Hi,
I’m starting slowly and want to control a servo using a simple switch.
I have the maestro 6 and can control it with the control centre.
I have looked at the document controlling a servo with a switch and copy and pasted that into the script section.

I’ve wired up my maestro with a 10k resistor and added a small switch but when I press it nothing happens.

should I copy and paste the script?
Is there a very simple test to see if its all wired up correctly and a simple script I can use to test it?

Any help would be gratefully received.

Thanks


#2

Hello.

Did you configure the mode of your button channel to be an input in the “Channel Settings” tab of the Maestro Configuration Utility? Please note that once you select “Input” as the mode for that channel, you need to click the “Apply Settings” button to upload the changes to the Maestro. If it is working correctly, you should be able to monitor that channel in the “Status” tab. When the button is not pressed, the slider should be to the right, and when you press it, it should move to the left. If that is happening, you can try running the example code by going back to the “Script” tab and clicking the “Run Script” button. Similarly to monitoring the button in the “Status” tab, you should be able to see the servo channel’s target position change when you press the button with the example running.

If it is still not working as expected can you post your Maestro settings file? You can save the settings file by selecting the “Save settings file…” button within the “File” drop-down menu in the Maestro Configuration Utility while the Maestro is connected.

Brandon


#3

Thanks for your reply.
I’ve checked all the settings and ‘applied’ the settings but still no movement.
I’ve attached my maestro settings file.

Thanks again, Jon
maestro_settings.txt (3.1 KB)


#4

Thank you for posting your settings file. It looks like your channel settings are all correct, and the script looks fine. I tried running the script on a Maestro here to reproduce the problem, but it seems to work fine for me.

Could you describe what happens in the “Status” tab when you press the button? If everything is connected correctly, the slider should be to the right when the button is not pressed, and move to the left when it is pressed. Also, could you test your servo separately by making sure the script is not running and moving the Channel 1 target position slider in the “Status” tab manually?

Brandon


#5

Hi Brandon,

Thanks again for your help.
I’ve just gone and wired up a second Maestro incase the first was broken but still the same so I’m obviously doing something wrong :blush:

If I plug in a servo I can control it using the control centre.

With no servo plugged in or with one in,
the input is to the left but doesn’t respond when I press the button.

I’ve attached images of the screen and also my wiring setup.

I hope this helps, I’m sure it’s something really simple I’m not doing :blush:

Thanks again,

Jon


#6

Hi Brandon,
Panic over, I changed the switches to Pololu switches and it all works now!

Thanks for your help

Jon


#7

I am glad you were able to figure out what the problem was and get it working!

Thank you for letting us know.

Brandon