
RobertL184
I am experimenting with expanding the number of servo ports I have available to the EZ -B with a Pololu Mini Maestro 24 channel USB servo controller. The Mini Maestro is normally used to provide servo control to a PC but it has a TTL serial interface which easily interfaces with a micro controller. So I am playing with the EZ-B's send serial command to get more digital and servo ports. The Mini Maestro even has some scripting capabilities. According to documentation the Mini Maestro script subroutines can be started from the serial port so the EZ-B should be able to kick off the Mini Maestro scripts. I haven't got the subroutines working yet, but I have played with controlling a servo and outputting to a digital port to blink an led from an EZ -Builder script.
Mini Maestro scripts are more complicated to write than EZ builder scripts but appear they could be useful for fixed activities like making antennas move back and forth and blinking LEDs. Perhaps even a fixed response to a switch or button.
The SendSerial command is the key.
24 more ports under ARC control. I will post more info as I get time.
I am not sure it is worth doing or not ( I will have to think about it some more) but I think it would be possible to write an EZ-B script to monitor a Virtual servo port and make the Pololu servo match the operation of an ARC servo Control that is set up for the Virtual servo Port. This would provide direct on screen control of the Pololu Servos from the ARC user interface. Of course there would be some lag between moving the control of the virtual servo and the actual operation of the servo on the Pololu Mini Maestro as the script would have to periodically check the value of the Virtual servo and send any change in position to the Pololu.
Both of the scripts I have posted function with ARC controlling Servos and Digital Outputs on the Pololu Mini Maestro. I may play with doing some subroutine scripts in the Pololu controller and trying to execute them from the ARC next.
Nice work.
You can use a script to monitor virtual ports by using the $virtualservo0 = GetServo(V0) command and use this to move the servos on the expansion. But, make sure you use a sleep in the script to avoid using too much processing power and saturation of the comms. Response will suffer a little though.
@Rich from an earlier comment >>To be honest, it's much easier to use multiple EZ-Bs than use these expansion boards that aren't supported by the native controls, require scripting to use, etc. etc. etc.<<
You make a very good point. When you consider the Pololu Mini Maestro gives you 24ch for servo or general I/o for about $50 and the EZ-B has (had) a cost of about $70 with more over all I/o and interfacing options along with native software support it makes the choice pretty hard in my mind.
@DJSures what might be neat to ponder is native support for i2c interface between EZ-B boards.
@RobertL184 thanks for sharing your experience with this board and your scripts. I hope your success continues. You are making me want to purchase one to experiment with.
I am going to put two RGB LED eyes on my robot. This would use up 6 ports. So I thought they would work decent on the Pololu controller if I could write a pololu script to break up a parameter sent by the ARC script into individual LED on/off codes. I also decided to move the ez-robot kit camera on/off push button over to the pololu and did a second pololu script to push the camera power on button. So here is the pololu script. It takes a value sent by ex-builder (0-63) and breaks it down to turn on and off the 6 LED outputs.
camera quit sub eyes dup 1 BITWISE_AND NONZERO IF 6001 6 servo else 1500 6 servo endif dup 2 BITWISE_AND NONZERO IF 6001 7 servo else 1500 7 servo endif dup 4 BITWISE_AND NONZERO IF 6001 8 servo else 1500 8 servo endif dup 8 BITWISE_AND NONZERO IF 6001 9 servo else 1500 9 servo endif dup 16 BITWISE_AND NONZERO IF 6001 10 servo else 1500 10 servo endif 32 BITWISE_AND NONZERO IF 6001 11 servo else 1500 11 servo endif quit sub camera 1500 12 servo 1000 delay 6001 12 servo quit
The ARC script I use to change the eye color is:
#Start a Pololu Script (Subroutine) and Pass a parameter #Pololu_Sub=Pololu Subroutine Number #Pololu_Value=Value to Pass to Subroutine $Pololu_Sub=0 $Pololu_Value=9 $LowByte=$Pololu_Value & 0x7F $HighByte=($Pololu_Value >> 7 )& 0x7F SendSerial(D17,9600,0xA8,$Pololu_Sub,$LowByte,$HighByte) Halt
The pololu compiled subroutine address the the eye subroutine is 0. And I am passing a value of 9 to make the both eyes red. Port 6 is left red, port 7 is left green, port 8 is left blue. Port 9 is right red, port 10 is right green, and port 11 is right blue.
Turning the camera on does not require a parameter. So it uses a slightly different script.
The subroutine in the pololu makes sure the button is in the off position for 1 second the puts the button in the on position.
#Starts a Pololu Script (Subroutine) without a value #Pololu_Sub=Pololu Subroutine Number $Pololu_Sub=1 SendSerial(D17,9600,0xA7,$Pololu_Sub) Halt
The pololu subroutine number for the camera script is 1.
I have the pololu script set up so it would turn the camera on automatically at pololu power up. The pololu has the ability to run a script on startup. In the script I posted earlier it would automatically power on the camera if the run script on startup were enabled.