Lego MT Robot Mindstorms Golf Programming Notes:
Avoid hitting red ball with colour sensing back-up and turn command.
Hit Blue ball with colour sensor and motor command.
- Open Mindstorms NXT program, orange icon.
- View short tutorial in both areas.
- Open new file and name it.
- Select complete palette.
- Start program with move command; it is the top menu bar, use motors A and B at a .1 duration, moving forward.
- Use a Loop command (loops till true) with the Sonar sensor as control in input 4 at 23cm, brake as next step.
- Add a switch (true or false decision) with a light sensor control to determine the next action.
- Next step is to check for colour with Ultraviolet sensor, use light enabled, calibrate to colour and set decision to accommodate the ball colours. Remember to take the ambient light into consideration.
- Turn command is in move, right or left, with duration of motor.
- You can drag a whole process into a loop or a switch.
- After completed attach robot and use download (not download and run) command to program into your robot.
- You can use file command to manage programs on robot.
- Select file you downloaded on robot and press run.
- Check operation and reprogram and download to overwrite.