Robot App Store

image description

Lego Colour Ball Sorting RobotRobot-App Page

Relevant Robots:
  • LEGO - Mindstorms NXT 2.0
Release Date:
3/9/2012
App Version:
2.0
App Size:
2.27Mb
Requirements:
See all requirements...
Click to download this app.        
App Categories:

Robot App™ Description

Lego Colour Ball Sorting Robot

Version 2 of the program improved matters in the following ways:
First, four MyBlocks were defined and incoporated to prevent the program from becoming unwieldy, and allowing one common bit of code to be reused within the program.

Secondly, logic was developed so that the turntable could move directly from one ball release to the next, avoiding returning to the parked position in between.

The four MyBlocks were called ZeroTurntable, CloseGate, SayColour and setposition

ZeroTurntable switched on the turntable motor A in reverse until it returned to the parked position, when it pressed touch sensor 2, stopping the motor.

ClosedGate switched on the gate motor B in reverse until it caused touch sensor 1 to be pushed, and then stopped the motor.

SayColour dealt with the five way switch. It had a numeric input in the range 2 to 6, and spoke the associated colour value (2) green (3) yellow (4) red (5) or in the case of the default 6 which corresponds to white it said No followed by Object Detected, both sounds in the standard vocabulary.

setposition received a numeric integer input(which would be in the range -3 to + 4, and produced two outputs. A true/false direction output, true for forward with positive numbers input and false for reverse with negative numbers input. The second output equalled the size of the number multiplied by 360 to give a degrees duration output for the motor. This was always arranged to be a positive number.

The new program employs two variables. One called lastcolour holds the number of the last colour ball detected, and the second position holds the turntable position in number of revolutions from the parked position which is defined as 0.

Developer: Robin Newman


LEGO®is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this app. This app does not feature any of LEGO's copyrighted or trademarked material, and is in accordance with their fair use guidelines.

Installation Instructions

Delivered as:
Code

Building Instructions: http://r.newman.ch/lego/colourballsorterNXT2.pdf

 

Robot App Requirements

Software

LEGO Mindstorms software
Hardware:

LEGO Mindstorms NXT 2.0 kit #8547
Other requirements:

One hour to build the robot.

Are you a robot-apps developer?

Joining the developer program is easy and FREE!