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

Code won't start
http://www.robotc.net/forums/viewtopic.php?f=63&t=9761
Page 1 of 1

Author:  lokken_samuel [ Fri Nov 07, 2014 10:22 am ]
Post subject:  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.

Author:  JohnWatson [ Fri Nov 07, 2014 11:32 am ]
Post subject:  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).

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