I'm curious about something I've been working on when I try to use it by pressing the button nothing happens I tried switching the buttons and the one that took the button I was using worked fine but the one I needed to fix still didn't work I'm not sure what to do I want it to go back and forth like a goalie sort of like pinballs or something like that
Attachments:
File comment: Its at the very bottom of the program do you have any ideas NXT Joystick Basic for xander.c [1.16 KiB]
Downloaded 149 times
Fri Apr 25, 2014 3:57 pm
Coder A
Moderator
Joined: Thu Jan 03, 2013 5:10 pm Posts: 207 Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Re: Remote control programing
Hello,
The problem is that your last if statement is outside of the while loop. Use the auto-format button (in the tools at the top of the IDE) to align your braces and see if you have problems, and to make your code cleaner. The loop's condition is 1 == 1 (tip: "true" means the same thing and is considered better practice), meaning that it will never exit, which is intended behavior. What is not intended is for your last if statement to be outside the loop. That code will never have a chance to execute.
_________________ I'm not a robot! I'm british! ~ quote from an asparagus I am not a robot! I am a unicorn! ~ quote from a robot
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum