About Lego:

There are two kinds of Lego robot:

                                                              1. NXT

                                                              2. EV3

NXT Robot:

1. Sensors

The Mindstorms NXT 2.0 kit comes with several different types of sensors. Lets see more details about those sensors...

Touch Sensor

Touch Sensor blocks are used to detect contact with an obstacle. If the Touch Sensor had contact with an obstacle, the sensor returns 1. The Touch Sensor consists of two blocks. Touch Sensor Interface block is an interface block to the outside of a NXT controller model. Touch Sensor Read block is used to read the Touch Sensor data. In simulation, these blocks are just place holders; however, they will be used to implement an appropriate device API in the generated code.

Color Sensor

The color sensor can be used to measure a limited range of colors. It can distinguish between black, white, red, yellow, green, and blue. It can also be used as a light sensor to measure the brightness of ambient light. The color sensor could be used to sort Lego bricks, make a robot follow a line, or have the robot respond to different colored lights.

Light Sensor

Light Sensor blocks are used to measure brightness. Greater value means darker (or lower reflection). Light Sensor consists of two blocks. Light Sensor Interface block is an interface block to the outside of a NXT controller model. Light Sensor Read block is used to read Light Sensor data. In simulation, these blocks are just place holders; however, they will be used to implement an appropriate device API in the generated code.

Sound Sensor

Sound Sensor blocks are used to measure the sound pressure. Smaller value means louder sound. Sound Sensor consists of two blocks. Sound Sensor Interfaceblock is an interface block to the outside of a NXT controller model. Sound Sensor Read block is used to read Sound Sensor data. In simulation, these blocks are just place holders; however, they will be used to implement an appropriate device API in the generated code. 

Ultrasonic Sensor

Ultrasonic Sensor blocks are used to measure the distance from an obstacle or to detect an obstacle without contact. Ultrasonic Sensor blocks consist of two blocks. Ultrasonic Sensor Interface block is an interface block to the outside of a NXT controller model. Ultrasonic Sensor Read block is used to read Ultrasonic Sensor data. In simulation, these blocks are just place holders; however, they will be used to implement an appropriate device API in the generated code. 

Motors

Servo Motor blocks are used to control a Servo Motor. Servo Motor consists of two blocks. Servo Motor Interface block is an interface block to the outside of a NXT controller model. Servo Motor Write block is used to set Servo Motor control data. In simulation, these blocks are just place holders; however, they will be used to implement an appropriate device API in the generated code.