Beginner here. Have PC mounted on and controlling differential drive platform w/DE sabertooth 2x25 speed controller in packet serial mode. For starters want to use onboard joystick to move the thing around the room to get it out of my way. Using roborealm I've dragged over the Joystick, VBScript Program, and DE_sabertooth modules.
I've written this to hopefully scale the variables properly but I cant get it to do anything at all. It says error (
expected ")" but as far as I can see the parens are all matched up. Please correct any errors you notice. Thank you.
dead_x = 4
dead_y = 10
scale_y = 0
scale_x = 0
motA = 0
motB = 0
while(1)
scale_y = ((-1)y_joy)(128/1000)+128 ;make joystick y an unsigned 8bit integer center at 128
if scale_y <= dead_y
scale_y = 0
scale_x = (x_joy)(128/1000) ;make joystick a signed 8bit integer center at 0
if scale_x <= dead_x
scale_x = 0
motA = scale_y+scale_x+128
motB = scale_y-scale_x+128
I've never programmed anything before and all the VBscript tutorials I've found are on HTML stuff. I'd like to use C but figure if I cant get this to work I'd have an even harder time with a compiler. Also, I would like the speed to start at 1 and move progressively once out of the deadband instead of suddenly jumping to 4 or 10. How would I do that?