2 ax2500 on once computer

14 years 8 months ago #11150195 by Adamj12b
Replied by Adamj12b on topic Re:2 ax2500 on once computer
I just stumbeled across these post's and was wondering if i could get a copy of that roboserver code for visual basic.

Please Log in or Create an account to join the conversation.

14 years 8 months ago #11152078 by cosma
Replied by cosma on topic Re:2 ax2500 on once computer
<P style="MARGIN: 0px">The file has been restored at:
<P style="MARGIN: 0px">
<P style="MARGIN: 0px"><A href="dev.roboteq.com/dev1/files/software/roboserver2.zip" target=_blank>www.roboteq.com/files/software/roboserver2.zip
<P style="MARGIN: 0px">

Please Log in or Create an account to join the conversation.

14 years 8 months ago #11241668 by Adamj12b
Replied by Adamj12b on topic Re:2 ax2500 on once computer
Thank you very much for the help. I was wondering if i could see the code that you have for roborun that query's the controller while it is running. also i was wondering if you knew how to convert the temp readings with visual basic. Help would be appreciated. - Adam

Please Log in or Create an account to join the conversation.

14 years 8 months ago #11242134 by cosma
Replied by cosma on topic Re:2 ax2500 on once computer
<P style="MARGIN: 0px">See the relevant code at <A href="dev.roboteq.com/dev1/files/software/run.txt" target=_blank>www.roboteq.com/files/software/run.txt
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">Note that in this code, the info is read from the controller in two modes:
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">1- Respond to discrete queries when the controller is in rs232 mode
<P style="MARGIN: 0px">2- parsing through the data logging stream that is output by the controller when in RC or analog mode.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">You may omit 2.

Please Log in or Create an account to join the conversation.

14 years 8 months ago #11252972 by Adamj12b
Replied by Adamj12b on topic Re:2 ax2500 on once computer
I cant get the temp conversion to work. I was wondering if i could just have the source to roborun cause i would also like to see how the joystick part works because i am doing something like that also.

Please Log in or Create an account to join the conversation.

14 years 8 months ago #11254167 by cosma
Replied by cosma on topic Re:2 ax2500 on once computer

The temp conversion routine is included in the file mentioned in the previous post. Source code in C is also included in the manual.
<P style="MARGIN: 0px">The joystick code uses a Visual Basic OCX object licensed from a third party. Note that the same is true for the strip chart on Roborun. So the roborun code is disapointingly simple when it comes to these parts. These OCXs are what makes VB so convenient. They will also make porting to another OS difficult if the same functions must be written from scratch.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">The code for the joystick is below. Note that this code has some added functionality for swapping the axes and swap polarity:
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">Private Sub JKJoystick1_PosChange(NewX As Long, NewY As Long, NewThrottle As Long, NewRudder As Long)
<P style="MARGIN: 0px">Dim ModX As Long<BR>Dim ModY As Long<BR>Dim Ch1 As Integer<BR>Dim Ch2 As Integer
<P style="MARGIN: 0px">If JoyXYSwap.Value = 1 Then<BR> ModX = NewY<BR> ModY = NewX<BR>Else<BR> ModX = NewX<BR> ModY = NewY<BR>End If
<P style="MARGIN: 0px">If JoyInvertX.Value = 1 Then ModX = 65535 - ModX<BR>If JoyInvertY.Value = 1 Then ModY = 65535 - ModY
<P style="MARGIN: 0px">xst = ModX<BR>yst = ModY
<P style="MARGIN: 0px">Ch1 = 0<BR>Ch2 = 0<BR> <BR>If JKJoystick1.TestStick(Val(JPortLbl.Caption)) = True Then<BR> <BR> If ModY &lt; 31500 Then Ch1 = Int(128 - (ModY / 31500 * 128))<BR> If ModY &gt; 34000 Then Ch1 = Int((ModY - 34000) / 31500 * -128)
<P style="MARGIN: 0px"> If ModX &lt; 31500 Then Ch2 = Int(-128 + (ModX / 31500 * 128))<BR> If ModX &gt; 34000 Then Ch2 = Int((ModX - 34000) / 31500 * 128)
<P style="MARGIN: 0px"> If Ch1 &lt; -127 Then Ch1 = -127<BR> If Ch1 &gt; 127 Then Ch1 = 127<BR> If Ch2 &lt; -127 Then Ch2 = -127<BR> If Ch2 &gt; 127 Then Ch2 = 127<BR>End If
<P style="MARGIN: 0px">xcom = Ch2<BR>ycom = Ch1
<P style="MARGIN: 0px">rudderst = NewRudder<BR>throttlest = NewThrottle
<P style="MARGIN: 0px">If Main.JoystickEnable = Checked Then<BR> <BR> Main.CmdVal(0).Text = Ch1<BR> Main.CmdVal(1).Text = Ch2<BR> <BR> Main.SpdSlider(0).Value = Ch1<BR> Main.SpdSlider(1).Value = Ch2<BR> <BR> <BR> ' Swapped X-Y for Saitek<BR> 'Main.CmdVal(0).Text = ch2<BR> 'Main.CmdVal(1).Text = ch1 * (-1)<BR> <BR> 'Main.SpdSlider(0).Value = ch2<BR> 'Main.SpdSlider(1).Value = ch1 * (-1)
<P style="MARGIN: 0px">End If<BR> <BR>End Sub

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.105 seconds