OoPic is connected to PC via rs232-serialport.
I should control two axis. When I'm sending orientation data trouhg
serialport. The 1st byte, 3th byte, 5th byte, ..., and so on tells the
orientation of the x-axis. And the 2nd byte, 4th byte, 6 th byte, ...,
means the orientation of the y-axis.
HOW I CAN MAKE THIS WORK ??
I'm testing my program by using two RC-servos.
I have tryed to save incoming serial data in obuffer2 and read the
bytes from there.
When I use the code below the first byte controls the servo "S" and
second byte controle the servo "S2", but also 3th, 4th and every
following bytes controls the servo "S2". So only the first byte
controls servo "s". I have also tryed two clear the buffer after the
both servos are posisioned but that doesn't seem to work.
**********************************************
Dim A As New oSerialPort
Dim buffer As New oBuffer2
Dim S As New oServo
Dim S2 As New oServo
Sub Main()
S.IOLine = 31
S.Operate = cvTrue
S2.IOLine = 30
S2.Operate = cvTrue
A.Baud = cv9600
A.Operate = cvTrue
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
********************************************
I know I could also use the 4 byte buffer that includes in
oSerialport, but I don't know how to read it from spesific address?
IS THERE ANY CHANCE TO MAKE THIS WORK LIKE THIS OR SHOULD I FIGURE OUT
SOMETHING COMPLITELY DIFFERENT?
thaks!
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