|
Page 1 of 1
|
[ 5 posts ] |
|
Author |
Message |
Erako
Rookie
Joined: Wed Jun 05, 2013 6:19 pm Posts: 3
|
 Color sensor
Hello, i need help please...
I try :
while (SensorValue[colorSensor] == BLACKCOLOR){ //test }
Don't work???
|
Wed Jun 05, 2013 6:23 pm |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: Color sensor
That is a functional command. Could you post your entire code?
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Wed Jun 05, 2013 6:32 pm |
|
 |
Erako
Rookie
Joined: Wed Jun 05, 2013 6:19 pm Posts: 3
|
 Re: Color sensor
Thanks for your time!
//Line reader with color task main() { int moveTo = 1; int move = 1;
while (true){ nSyncedMotors = synchAB; do{ motorA = 50; }while (SensorValue[colorPort] == BLACKCOLOR)
nSyncedMotors = synchNone; // On arrete la synchronisation des moteurs do{ motorA = -moveTo; motorB = moveTo;
moveTo = moveTo + move; if (SensorValue[colorPort] != BLACKCOLOR){ motorA = moveTo; motorB = -moveTo;
moveTo = moveTo + move; } }while (SensorValue[colorPort] != BLACKCOLOR) } }
|
Wed Jun 05, 2013 7:16 pm |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: Color sensor
Next time please use the tags when posting code.  You had some syntax errors in the code, and never defined the port that the sensor was on. I got it to the point where there were no errors, but no guarantees that it's bug free.
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Wed Jun 05, 2013 7:53 pm |
|
 |
Erako
Rookie
Joined: Wed Jun 05, 2013 6:19 pm Posts: 3
|
 Re: Color sensor
Thank you! 
|
Thu Jun 06, 2013 4:12 am |
|
|
|
Page 1 of 1
|
[ 5 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
|
|