>Do
>If A.Received = cvTrue Then
>
>buffer.Value = A.Value/4
>
>buffer.Location = 0
>S.Value = buffer.Value
>
>buffer.Location = 1
>S2.Value = buffer.Value
>
>End If
>
>
>buffer.Clear = cvTrue
>
>Loop
>End Sub
As you know (by observation), that code does not send the odd bytes
to S and the even bytes to S2. The logic is all wrong.
You need something like this:
Byte flip
flip = 0
Do
..if A.Received Then
....flip = 1 - flip ' flip odd/even on each received byte
....if flip Then
......S = A ' odd: control first servo
....Else
......S2 = A ' even: control second servo
....End If
..End If
do any other required stuff here...
Loop
...Andy
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/oopic/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/oopic/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
No comments:
Post a Comment