Picaxe to control a pololu servo board

Pat13

Senior Member
I am a total newb but I am fascinated by the possibilities of the picaxe for my purposes, which is Halloween props. I can follow a schematic and understand the basics of electronic components. I pore over the 3 picaxe manuals, especially manual 2 but it is the "language" of the picaxe that I am stuggling with.
Here is what I am trying to do:
I have a witch prop with a 3 axis servo neck (driven by the pololu micro maestro http://www.pololu.com/catalog/product/1350 )The maestro has a tx and an rx line, as well as the ability to use a contact switch.
My question is, what code do I use thru the RX to turn the maestro on/off? Or should i just switch it using the other input
I may be trying to run before i can walk, but i figure I've got a few months til Halloween to figure it out lol!
 

Marcwolf

Senior Member
Hi there Pat13
Just need some clarification of your understanding of 'turnng the Maestro Off'

Are you wanting to actually power down the servo to save power, or power down the Maestro board to save power.

For 3 servo's you can easily use the PicAxe without any other hardware. Look at the Servo and ServoPos commands. When you want to power down a servo just set that output pin to 0.

If you want to use the Maestro then this link contains the relavant information re controlling the servo.
http://www.pololu.com/docs/0J40/5

Hope this helps
Dave
 

fritz42_male

Senior Member
I use Picaxe and Polulu (Micro Maestro) on various Halloween stuff.

The Micro Maestro has it's own onboard scripting so you shouldn't need the Picaxe under most circumstances. It will happily accept inputs from PIRs and other sensors.

Exactly what are you trying to do?
 

Pat13

Senior Member
I use Picaxe and Polulu (Micro Maestro) on various Halloween stuff.

The Micro Maestro has it's own onboard scripting so you shouldn't need the Picaxe under most circumstances. It will happily accept inputs from PIRs and other sensors.

Exactly what are you trying to do?
The prop is going to consist of the 3 axis neck, one arm with a servo hand/fingers, the other arm that moves in/out at the shoulder and up/down at the elbow using two motors (will be holding an eye, like the witches in Clash of the Titans) and then a scary terry audio servo driver with this recording module http://www.electronics123.com/s.nl/it.A/id.3041/.f
I will probably use a PIR as the switch for the picaxe and then have the picaxe be the master control for all the other items.
 

Pat13

Senior Member
Have a look here. Steve/Halstaff has been using Picaxe with PIR to switch motors, solenoids etc.

http://www.hauntforum.com/forumdisplay.php?f=35

There are 5 Picaxe projects currently on the go.
I've been following Steve O and Halstaff threads, both on Hauntforum and GoE. I've posted my own, which Steve O helped with some of the code.
http://www.hauntforum.com/showthread.php?t=25855
What I am struggling with is the coding :confused:. It is a language and I want to be Shakespeare but I'm not even Sesame Street, lol!
As I said, I keep poring over manual 2. I'm also one of these learners that has to talk things thru until I understand. It'll come, I know that, I just want to run while I'm learning to crawl!:D
 

Pat13

Senior Member
I got a response back from someone on the Pololu forum and they thought that I should be controlling their board with the picaxe as long as it can send non-inverted TTL signals. This way, one could also "randomize" the movements of the servos, getting a more natural movement from the mechanism.
I have been reading manual 2 and by using the "serout" command it would appear that this is possible. My problem is I am a complete newb. Steve O from the Garage of Evil Halloween Network has been very generous with his time in helping me to understand code and I feel more confident in the basics of code, including the use of variables and some maths, modulus being one. However, I don't want to tax his generosity. So I'm hoping to get some help from the folks here. I can provide info on the Pololu if required.
 

BeanieBots

Moderator
Correct, serout can do either true or inverted logic.
As for the other stuff, ask away. We're here to help:)
A good read of manual 2 will go a long way to help understand what all the commands do.
 

Pat13

Senior Member
Ok so on serout, declare pin and the baudmode of device picaxe is trying to connect with, correct? From this point (data) is where I get confused. If I have 6 different channels (as they are called on the pololu) with a servo on each channel, and I want to send them to random positions, where does my code go from here? It doesn't look like I can use the type(?) of coding I have used thus far. I am reading thru manual 2 on a daily basis and some of it is beginning to make sense but a lot is still a mystery to me :confused:
 

BeanieBots

Moderator
Not sure what you are having difficulty with.
The serout command is clearly explained. (logic polarity is defined within the baud setting). eg N2400 or T2400.
PICAXE can generate random numbers, so make a random in the desired range and then send it using the correct polarity baud-rate.
 

Pat13

Senior Member
Not sure what you are having difficulty with.
The serout command is clearly explained. (logic polarity is defined within the baud setting). eg N2400 or T2400.
PICAXE can generate random numbers, so make a random in the desired range and then send it using the correct polarity baud-rate.
Put it this way, I took consumer math (basically how to make change) in high school 30 years ago :D and have no experience with coding prior to a month ago.
So perhaps something like this;

symbol position = w0
Main:
random position
position = position // 75 + 225
serout C.3, T9600_8, position


sorry, could not figure out how to encapsulate the code
 
Last edited:
Top