loading
 
NXT Motor Variables
blackhawk92 from Germany  [3 posts]
15 year
Hey Guys,

I think I've got a problem with my NXT and the Motor Variables.
I tried to program a robot like the modified tribot in the tutorials but the nxt doesn't accept changes of the variables.

I've got this VBScript wich changes the Motor-Variables but the nxt-Module doesn't use the changed values.

left_motor = 128
      right_motor= 128

mittex = (GetVariable("IMAGE_WIDTH")/2)
abstandx = GetVariable("COG_X")-mittex

if abstandx < 0 then
    left_motor = 60
   right_motor= 128
  else
    if abstandx > 0 then
      left_motor = 128
      right_motor= 60
    else
      left_motor = 128
      right_motor = 128
    end if
  end if

SetVariable "left_motor", left_motor
  SetVariable "right_motor", right_motor


And there's another problem, but I think when the other is solved, this one is solved too:
When I click on the start button in the NXT-module, the variable from motor B is automatically set to 0.

I hope you can help me,
blackhawk

PS: Sorry for my (maybe) bad english, I'm from Germany.
Win Heagy from United States  [31 posts] 15 year
Hmmm...is this similar or in some way related to the problem I've been having?
http://www.roborealm.com/forum/index.php?thread_id=3048#

Win
blackhawk92 from Germany  [3 posts] 15 year
Yes, this sounds very similiar to my problem, but now, we still need someone who can help us.;-)


Please, we need help,
blackhawk
Anonymous 15 year
Naturally things work fine for us so we are unable to replicate your issue.

Can you post your robofile that uses the NXT so that we can determine what you are trying to do?

Sounds like you just do not have the motor variables mapped (i.e. specified in the dropdown) in the NXT GUI ... but the robofile will tell us that.

STeven.
blackhawk92 from Germany  [3 posts] 15 year
OK, here I is
program.robo
Anonymous 15 year
blackhawk,

Seems that your robofile is not quite correct. You have calculated and created two variables left_motor and right_motor in the VBScript module but you do not specify them in the Lego_NXT Motor dropdowns (as was mentioned in our previous post). You DO have an unknown variable "Moto" specified in the B motor but that does not appear to come from anywhere or have any relevant values.

Try selecting left and right motor variables using the provided dropdowns (you will see those variables in there) but be sure to specify the correct A,B, or C motor depending on your robot.

Let us know if you continue to have any issues.

STeven.

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