Using Servos with Vixen and Arduino

Joe Paul

Supporting Member
Hi Folks,

So I have been getting unexpected behavior using code from here:

https://www.instructables.com/Talking-Pumpkins/

But I am using it to animate Peanuts figures like I've done here:


I the motion above is random; I want to time it to the music.

So my question is about using an older version of Vixen. I am using Win 11 with the latest release of Vixen.
What would be the best version to downgrade into. I suspect that the code on that page is over 10 years old. I am very familiar with using servos, understand their power requirements, etc. I suspect it has something to do with the way the serial is being sent to the Arduino. The code works intermittently it seems. Seems ther serial communication is being corrupted or garbled.

Any help much appreciated!

Thanks and wising everyone a very Blessed and Merry Christmas!!!!!!

Take care, Joe.
 
I'm not following why you want to downgrade Vixen to an older version? Maybe try a serial monitor application on your windows PC to check what's actually being trasnmitted - for example WireShark. The current version of Vixen supports serial 'controllers'. Where most people fall down is not 'framing' the data correctly, i.e. adding a header to identify the start to the byte values. I would start with one of the many examples of controlling pixels using Vixen / Arduino. You would use single colour lights in Vixen for servos, so each uses one channel and outputs a valuable 0->255. In your Artdino code you use these value to drive your servo(s)

I took a quick look at the example sketch, that's exactly where it's going wrong. There is no header to identify each 'frame' of data. As mentioned I'd look for some better examples and adapt them to control your servos. With that code, what gets output will indeed be very random, as there is no synchronisation between incoming data and the required behaviour to map it to the correct outputs.
 
Last edited:
I'm not following why you want to downgrade Vixen to an older version? Maybe try a serial monitor application on your windows PC to check what's actually being trasnmitted - for example WireShark. The current version of Vixen supports serial 'controllers'. Where most people fall down is not 'framing' the data correctly, i.e. adding a header to identify the start to the byte values. I would start with one of the many examples of controlling pixels using Vixen / Arduino. You would use single colour lights in Vixen for servos, so each uses one channel and outputs a valuable 0->255. In your Artdino code you use these value to drive your servo(s)

I took a quick look at the example sketch, that's exactly where it's going wrong. There is no header to identify each 'frame' of data. As mentioned I'd look for some better examples and adapt them to control your servos. With that code, what gets output will indeed be very random, as there is no synchronisation between incoming data and the required behaviour to map it to the correct outputs.

Hi Richie,

Many, many thanks for the reply!!!
Here's my flawed reasoning: Since these people who have had successful results (with that simple code with no header) were using a 5-7 year old version of Vixen, I figured it was as easy as a downgrade.
I tried another sketch
https://github.com/jackStalnaker/singingpumpkins/blob/master/singingpumpkins.ino
with a header but couldn't get it to work.
I am getting better results with another Wn 11 machine, but not dependable.

I will look for other code with a serial header. Not much with servos out there. So I have to look for pixel contro sketches instead.

Take care, Joe
 
I should add something else you might find useful for debugging is an I2C LCD display. these are commonly 2 or 4 line. These connect Analog pins (A4 and A5 IIRC), you can write your 'channel values' to these to see what's actually going on, and it keeps your other pins free for whatever you want to control.
 
I should add something else you might find useful for debugging is an I2C LCD display. these are commonly 2 or 4 line. These connect Analog pins (A4 and A5 IIRC), you can write your 'channel values' to these to see what's actually going on, and it keeps your other pins free for whatever you want to control.

Thanks, againg, Richie!

I replied to your first post but it hasn't appeared yet.

I am playing around with the code. Should have a solution soon.

Take care, Joe.
 
Your post hadn't appeared because it went to moderation (don't ask me why, because I don't know) waiting for a moderator to approve it. There seem to be only two active moderators right now, and it's easy for us to to miss posts that need approval.
 
Your post hadn't appeared because it went to moderation (don't ask me why, because I don't know) waiting for a moderator to approve it. There seem to be only two active moderators right now, and it's easy for us to to miss posts that need approval.

Thanks, Phil, for the clarification!!!
 
Back
Top