loading
 
interfacing vbscript with serial
paddy from Ireland  [4 posts]
15 year
hi im trying to send variables for the joystick controls via serial to a board but i dont want to use the original variable for the x and y axis movement of the joystick. i want to edit these original variables with vbscript and then send the new variables via serial
Baghdad_boy from New Zealand  [11 posts] 15 year
Hey Paddy,

From what I've experienced with Roborealm is that it won't let you manipulate the variables directly. First you have to parse them using GetVariable. Then you can put them in your own variable using SetVariable.

For example
tempx = GetVariable("Joy_Stick_X") // Get the X value for the Joy Stick and put it in some temporary variable.

SetVariable "My_new_x", tempx + some_value // Make your own variable. You can then manipulate the tempx by adding or subtracting form it etc.

You can then send the "My_new_X" value through the serial port.
Also note that I don't know the exact names of the variables for the Joy Stick X and Y. You can find those in the list of Available Variables in the VBScript dialogue window.


Hope this is what you needed. Let me know if you run into any problems.

Baghdad_boy

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index