loading
 
joystick
CJ from Australia  [21 posts]
13 year
hi there i was wondering how i can make my triger button (button one) on my jstick control motor c forward on my nxt i gave my nxt motor c variable
" turn" and put" turn" in the variable box under button one from the joystick module but my nxt just continuesly turns how can i make motor c go forward when button press and stop when button not press also i want to control motor a direction with the x coordinates of my joystick like when joystick is turned lft then motor a go left how do i do these things

thanks in advannce
Anonymous 13 year
CJ, its probably just easier if we modify your robofile that you have. Can you include it here in a post? We'll have a look and make the needed changes.

STeven.
CJ from Australia  [21 posts] 13 year
ok here is the robo file thanks for answering by the way
program.robo
Anonymous 13 year
Cj,

See the attached robofile that uses the recently released Differential Drive module which makes this process much easier. You will need to download the latest copy for this to work.

Note that you cannot directly connect the Joystick variables which range from -1000 to 1000 to the NXT motors which expect 0 to 255 values. The Differential drive module helps to map these values correctly and translates the joystick movements (vertical/horizontal movement) to motor movements (left and right motors).

Note that motorc is turned on (set to 255) when button 1 is pressed (the If statement does this) and otherwise is set to 128 (neutral).

STeven.
program.robo

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