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

Pololu Forum

Newbie with an animatronic to build

I’m new to electronics and microcontrollers. I have purchased a micro 6 servo controller and a picaxe 18M2 microcontroller. I am going to build a animatronic witch for a Halloween display and will use the micro 6 to control the servos in a 3 axis head/neck mechanism. I will use the picaxe as Master (it will be controlling some other motors and an audio device). I have had some assistance in programming the picaxe and am beginning to understand code (as it relates to picaxe, anyway)
I have 2 questions:
what would be the best way to have the picaxe activate the micro 6, thru the RX line or address one of the channels as an input?
Second question: can the micro 6 be programmed to “randomize” servo positions in order to get a more “natural” looking head movement?

Hello,

Can your picaxe send non-inverted TTL serial data? If so, you should definitely try to do it with RX. If you are controlling it that way, I recommend generating the random numbers on the picaxe and using them to generate the appropriate motion commands.

-Paul

I believe it can, by using the serout command, here is what the manual says:
Baud mode specifies the baud rate and
polarity of the signal. When using simple resistor interface, use N (inverted)
signals. When using a MAX232 type interface use T (true) signals. The protocol is
fixed at N,8,1 (no parity, 8 data bits, 1 stop bit).
A ‘N’ baud rate idles low, with data pulse going high.
A ‘T’ baud rate idles high, with data pulses going low. When using a T baud rate
the very first byte may become corrupt if the output pin was low before the serout
command (the pin will be automatically left high after the serout command). To
avoid this issue place the line high (via a’high’ command’) a few milliseconds
before the very first serout command.
The # symbol allows ASCII output. Therefore #b1, when b1 contains the data
126, will output the ascii characters “1” ”2” ”6” rather than the raw data 126.
Please also see the interfacing circuits , affect of resonator clock speed, and
explanation notes of the ‘serin’ command, as all of these notes also apply to the
serout command.
Example:
main:
for b0 = 0 to 63 ; start a loop
read b0,b1 ; read value into b1
serout 7,N2400,(b1) ; transmit value to serial LCD
next b0

I kind of understand this, sort of, somewhat