'' bluatigro 27 apr 2018 '' dark line follow '' volg donkere lijn '' robot wil follow a dark line '' robot vlogt een donkere lijn '' const's init '' constanten init colport = 1 colreflect = 0 ''readpercent colambient = 1 ''readpercent colcolor = 2 ''readrawvalue rgbraw = 4 ''readraw irport = 4 irproc = 0 ''readpercent = cm irseek = 1 ''readraw = angle , dist irremote = 2 ''readraw[ 0 ... 3 ] = channel[ 1 ... 4 ] Sensor.SetMode( colport , colreflect ) Sensor.SetMode( irport , irremote ) EV3.SetLEDColor( "ORANGE" , "PULSE" ) irkey = Sensor.ReadRaw( irport ) While irkey( 0 ) <> 3 And irkey <> 4 irkey = Sensor.ReadRaw( irport ) EndWhile ev3.SetLEDColor( "GREEN" , "PULSE" ) ' main lus | loop While irkey( 0 ) <> 1 And irkey( 0 ) <> 2 light = Sensor.ReadPercent( colport ) irkey = Sensor.ReadRaw( irport ) If light < 50 Then Motor.MoveSteer( "bc" , -15 , 75 , 30 , "false" ) Else Motor.MoveSteer( "bc" , 75 , -15 , 30 , "false" ) EndIf EndWhile