OK i am working with Robot C which is a C based program and I was wondering how I should go about my problem. (im in high school) I dont know if this is the way to do it but i have two while loops.
If you are lost by now and dont understand what I am trying to do then i will tell you. I am trying to have my program run my first while loop (while x==1) but if the sensor reads < 20 then x should equal 2 and should skip two my secound while loop (x==2) I am not sure if this is how you do this but i dont see why not...so please help
There's a problem with unmatched braces here, a '}' is missing.
I'm not sure where it should go, as there's no indentation as a guide.
Please use code tags when sharing your code, and proper indentation to show the structure. [code] your code here [/code] using the <> formatting button on the right.
Also, task is not a valid keyword, the function should be defined as
Robot C is a bit different and i have realized im on a C++ site but the robot C people are all my age and dont know what they are doing. Im more worried about the program it self. The first while loop goes from line 16 to line 51 i dont see where your talking about.
im sorry i was looking at my program. It starts at 7 and ends at 42. I want the program to change from line 7 while loop and line 44. I made x a float because i tried making it a variable and an integer but it didnt even work remotely. When i am in the debugger it show that x will change but it wont run the lines from line 45 to 57.
Other than the possible problem testing a float value (though comparing it with an integer such as 1.0 or 2.0 should be ok), the code looks reasonable.
However, you also have an inner while loop from lines 9 to 21. while(SensorValue[IRSeeker] == 5) does this condition ever change, or might the program remain within this loop?
No, what you think of is the function exit(), break; in thiscase just exits from the enclosing while not more
o ok ya sorry ha and cool this should help thanks so much