View unanswered posts | View active topics It is currently Mon Oct 20, 2014 7:20 am






Reply to topic  [ 2 posts ] 
Remote control programing 
Author Message
Rookie

Joined: Fri Apr 25, 2014 3:48 pm
Posts: 2
Post 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 36 times
Fri Apr 25, 2014 3:57 pm
Profile
Moderator
Moderator

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 198
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post 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


Fri Apr 25, 2014 7:13 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.