ROBOTC.net forums
http://www.robotc.net/forums/

Remote control programing
http://www.robotc.net/forums/viewtopic.php?f=1&t=8604
Page 1 of 1

Author:  programminglord749 [ Fri Apr 25, 2014 3:57 pm ]
Post subject:  Remote control programing

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 252 times

Author:  Coder A [ Fri Apr 25, 2014 7:13 pm ]
Post subject:  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.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/