View unanswered posts | View active topics It is currently Tue Jul 23, 2019 5:38 am






Reply to topic  [ 2 posts ] 
Code won't start 
Author Message
Rookie

Joined: Fri Nov 07, 2014 10:14 am
Posts: 1
Post Code won't start
I am having an issue where my program does not start when I hit start. The Following is the line of code where the program stops-

if(SensorValue(OnAndOff)==100)

OnAndOff is a line follower/light sensor and I have tried it with and without an object blocking the light. It still does not work. I am still relatively new to the program and don't much understand what I am not doing or doing wrong. My process was as follows,

1. I downloaded the program to a VEX robot in natural language with no issues
2. I hit start on the program after it was downloaded and it immediatly stops
3. I changed the SensorValue from being 1 into it needing to be 100 for the program to start, and attempted to download again
4. It again stopped after reaching the line of code in question.


Last edited by lokken_samuel on Tue Nov 11, 2014 10:20 am, edited 2 times in total.



Fri Nov 07, 2014 10:22 am
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 722
Post Re: Code won't start
Please post the entirety of the code using the [code] blocks as this will help us determine what the cause of the issue is. Also, you may need to rethink your code; the light sensors will normally return a range of values (0 to 100 for the NXT and EV3, 0 to ~4095 for the Cortex, and 0 to ~400 for the IQ). In normal circumstances, the sensors will NOT return a specific value of 1 as that is either a very dark or very light object (depending on the platform/sensor being used).

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our updated help documentation and the ROBOTC Forums.


Fri Nov 07, 2014 11:32 am
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.