Servo and high/low at a time?

coparu67

Senior Member
Hi
Is there any trick to use a servo and high/low commands at a time?
I'd like to use leds with a servo in a same proyect.
 

hippy

Technical Support
Staff member
On separate pins there should be no problem with that.

On the same pin you can possibly have the servo running or LED on but not both, and it would depend on the servo what it does when not seeing an active signal.

There likely are some tricks you could do with other pins and hardware to make it work but it would be easier and more sensible to move the LED to that pin.
 

coparu67

Senior Member
Sorry, when I was reading the manual I understood that any high/low at any pin should stop the servo. It was my mistake.

However, if I try to use servo/servopos, a pause, and a piezo (at another pin) with play-note I get a small 'jitter'. Could it be avoided?
 

hippy

Technical Support
Staff member
However, if I try to use servo/servopos, a pause, and a piezo (at another pin) with play-note I get a small 'jitter'. Could it be avoided?
Possibly not easily. The PICAXE dedicates itself to playing the note and that may disrupt the background servo pulse timing. You may be able to tweak the PAUSE time to reduce or avoid the jitter. Or you could try disabling the servo while playing a note.

If you implement your servo control with a timed loop rather than SERVO and SERVOPOS commands, you may be able to put the note playing in place of the loop delay when it is required.

A second PICAXE which plays a note in response to an output from the first going high or toggling may be another option. You could use HSEROUT to allow for more than just one note without disrupting the servo timing, but SEROUT probably will disrupt timing if playing a note does.
 
Top