> Your dedication is impressive!
So is yours, you are still helping me, thanks!
> My eye fell on line 173-197. Servo-numbering starts at one, not zero.
> Don't recall if we have a standard for this, but zero seems more
> logical to me.
>From timer0_interval sample:
alias led is pin_b6
alias led_direction is pin_b6_direction
alias led2 is pin_a1
alias led2_direction is pin_a1_direction
Where is led 0?
Starting at 0 is logical for ports and numbers, but i don't find it
logical for device number.
> But aside that: the code is repeated 8 times, where it
> could be one if you use the servo number as array subscript.
> I'll leave it that, since I don't want to play the same tune over and
> over again while you put in so much effort...
You are right on lines 173-197, I will correct that. I need to stop
repeating my code.
But this part here line 69-109, I don't see how I can NOT repeate it:
if defined(servo_2) == TRUE then
if servo_num == 1 & servo_1_on then
servo_2 = level
end if
end if
if defined(servo_3) == TRUE then
if servo_num == 2 & servo_2_on then
servo_3 = level
end if
end if
I must repeat it because servo_x is not an array, and I can't make it
an array. Or can I? I don't want all the servo's to require a
dedicated port. I can however change it to elsif. I also want the if
defined to be calculated at run time.
Joep, I have not hear you complain about this method I am using for
steps, so I assume it is ok with you? With a 16 bit timer, steps will
be accurate to 0.8us.
Should a 16 bit timer be mapped to a byte or a word? 8 bit timers will
be byte. I think 256 locations is enouf for a servo, what do you guys
think? If someone wishes to use exact steps and more steps, they may
directly modify _servo_pulse[x]. I will remove the "_". As I
explained, 16 bit timers would have about 3200 steps at 20mhz, so
0.8us steps.
Thanks,
Matt.
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en.