Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Task B testing
- task main()
- {
- //Initial declarations.
- SetSensorTouch(IN_1);
- SetSensorLight(IN_3);
- int light = 58; dark = 48
- int power = 50;
- int part = 0;
- while(SENSOR_1 == 0)
- {
- //Loop while it finds the line.
- while (part == 0)
- {
- //Loop when on white.
- while(SENSOR_3 > dark)
- {
- OnFwdReg(OUT_BC, power);
- }
- //Segment when it hits black.
- RotateMotor(OUT-C, -power, 180);
- }
- //Loop after the line has been been found.
- while (part == 1)
- {
- //PID & Timer goes here
- }
- //Segment to stop.
- while (part == 2)
- {
- Off(OUT_BC);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement