Exception Violation Report 14
I'm asking my question on this forum because a) I have no idea how to fix it, and b) I haven't been able to find any instance of anyone who has had this specific problem, however, I do realize that several people have had this general error, such as this person: viewtopic.php?f=1&t=3312
This is the exact error I'm getting:ROBOTC Exception Violation Report
Byte Code Interpreter Exception:
Program Slot: 0, Task ID: main
Error at PC: Sub: readSonar1+0x002A
Task PC: Sub: readSonar1+0x002A
Exception Type: 'Shift value Out of range(14)'
Anyways, to clarify, I have RobotC v2.26, running on a Windows XP system (if that information helps at all.)
I am trying to write a program where I have a simple two-wheeled, individual-wheel-drive robot with one SONAR sensor mounted on a motor at the front. I am running a fairly basic code (see below for an example of v2.01 of the code). However, it does not matter what the rest of the code is, but whenever the program is running, as soon as it tries to execute this line:
and/or this line:
I get the error and the program quits/stops. Any help on this error would be greatly appreciated.
(I have tried restarting RobotC and my computer, and that makes no difference.)
Essentially I'm getting an error when I try to compare a known value to the SONAR sensor value. (I haven't checked to see if the light sensor/sound sensor also get this error, although I'm assuming they would.)