|
|
 | | Re: FindLight
|
| Thanks. I thought setting maxlight before the 'if' statement would be enough, but moving it closer to the front (before the 'while' statement') did the trick. The bit after the while loop still gives me pain though. I've changed it a bit to be able (...) (19 years ago, 25-Feb-07, to lugnet.robotics)
| | |  | | Re: FindLight
|
| (...) Looks like you're setting maxlight = SENSOR_2, then testing if (SENSOR_2 > maxlight), which will rarely (if ever) be true, because the value of SENSOR_2 is unlikely to change in such a short time. I think the first maxlight = SENSOR_2 (...) (19 years ago, 25-Feb-07, to lugnet.robotics)
| | |  | | Re: FindLight
|
| Thanks for the reply. I see I overlooked something significant there. Going over it all again I think I don't need 'light' Also, the parse errors are due to my omitting the ; at the end of each statement I've also discovered that I should put some (...) (19 years ago, 25-Feb-07, to lugnet.robotics)
| | |  | | Re: Power Functions Element Pics (inc Plugs)
|
| (...) I'm guessing there's a video. If so, I would recommend putting the video in a sub-folder by itself, as it is probably what is causing the delay. ROSCO (19 years ago, 25-Feb-07, to lugnet.technic, lugnet.robotics)
| | |  | | Re: FindLight
|
| Please try some semicolons on your lines! Chris (...) //findlight.nqc #define A OUT_A #define C OUT_C int light, maxlight, time; int turntime = 500; //change to accomodate 1 turn task main() { SetSensor (SENSOR_2, SENSOR_LIGHT); ClearTimer (0); (...) (19 years ago, 25-Feb-07, to lugnet.robotics)
| |