Sample code

I am looking for some sample code for Basic Stamp 2 for the Micro Serial Servo Controller. I want to controll 5 servos.

Also, if I send serial commands from the Micro Controller to a motor controller that accepts PWM. Will that work?


Really all you need is to get your BS2 outputting serial bytes, then it’s all about picking which bytes to send. You might want to take a look at the Basic Lego Robot sample project. It uses a BS2 and a Pololu Micro Dual Serial Motor Controller, which uses very similar serial commands to the micro serial servo controller.

What specific motor controller are you trying to use? In general no, serial commands from your microcontroller won’t do anything useful for a motor controller that wants a PWM input signal. Depending on the motor controller you may be able to use a spare signal line from your servo controller to run it (if it wants low-frequency hobby servo-type PWM signals).



The resources tab has a document about using the servo controller with the BS2.

- Jan