C# to control ShiftBars with Maestro

I have a Micro Maestro with servos connected on pins 0-2. I’m able to control the servos just fine using the USB connection and the USC and USBWRAPPER classes… Essentially, I’ve taken the C# code that was provided in the Advanced Example in the Pololu USB SDK and I’ve put my own code in and changed several things. So, I’ve got that working.

My question, then, is about hooking up a ShiftBar to the pins 3-5 and controlling it using the same C# code I’ve written. I haven’t seen any C# code examples out there to help me understand what options I have in the way of controlling the ShiftBar using C#. I’ve read the documentation for the Maestro code and it makes sense, but I’d really like to use the same program to control both.

Has anyone out there done something like this? Is there a code example somewhere I can check out? Thank you.

I see people looking at this… any responses?

Hello.

There are a variety of different ways to control ShiftBrites, each using different amounts of Maestro Script.

One way is to not use any Maestro scripts. You would do this by using Usc.setTarget to produce the protocol the ShiftBrite recognizes. However, I suspect the result will be slow because it will have to do several USB transfer for every bit you change.

Another approach would be to use Maestro scripts to do the low-level ShiftBrite protocol, while a computer program sets the RGB values through 3 servo channels that store the values. Someone did this using VB.NET. This approach would take all 6 channels leaving none for your servos, though.

Another approach would be to store the color sequences in the Maestro Script and call the sub-routines with your computer program.

- Ryan

Helpful! Thank you. I’ll have to look in to this more.