Sensor blocks for the LEGO Mindstorms software are now available on the HiTechnic Downloads page that add support for the HiTechnic Sensor Multiplexer (SMUX). In addition to SMUX support, the new HiTechnic Color, Compass, Acceleration, and Gyro sensors also add support for the data logging feature of the Education Edition of the LEGO Mindstorms 2.0 software. There are also blocks available for the LEGO Touch, Light, Sound, and Ultrasonic sensors that make it possible to use these sensors with the SMUX. This post will describe how to use these blocks in your NXT-G programs.
The new SMUX enabled blocks for the HiTechnic sensors replace old the HiTechnic sensor blocks. These blocks can be used both with and without the SMUX. The new HiTechnic sensor blocks, as well the SMUX LEGO sensor blocks, work with all versions of the LEGO Mindstorms software including 1.0, 1.1, and 2.0, both retail and educational editions.
You will find the new blocks on the HiTechnic downloads page. You can also find the blocks with the SMUX support on the bottom of the SMUX product page. If you need help downloading and installing sensor blocks, please look at Using HiTechnic sensors with the LEGO Mindstorms software.
Using the blocks without the SMUX
The new sensor blocks can be used without the SMUX just like the old blocks. In the configuration panel, simply choose the port that you are using for the sensor. For example, the configuration panel for the Acceleration Sensor with port 3 would look like this:
Note the small arrow on the end of the port selection line of the configuration panel, this is what you will use for the selecting the SMUX port.
Using the blocks with the SMUX
To use the sensor blocks with the SMUX, first set the port number on the configuration panel to the port the SMUX is connected to. Then click on the small arrow next to the port numbers. This will switch the port selection group to the SMUX ports. Here you first need to click on the check box next to MUX -> Sensor and then the port number of the SMUX. For example, if you want to connect the Acceleration sensor to the SMUX port 2 and the SMUX is connected to the NXT port 4, then the first port selection on the configuration panel will be for the SMUX and will look like this:
Then after you click on the small arrow on the port selection line you click on the check box indicating you are using the SMUX and then you select port 2 to indicate the sensor is connected to port 2 of the SMUX. The configuration panel will now look like this:
The arrow on the port selection line toggles between the NXT port numbers and the the SMUX port numbers. If you need to go back and change the NXT port number, click on the small arrow again and you will go back to the NXT port selection group.
That’s it. You can now wire the SMUX sensor block just like you would a regular sensor block.
Using the LEGO Light, Touch, Ultrasonic, and Sound with the SMUX
Also available for download are sensor blocks for these LEGO sensors.
These sensors blocks do not replace the original LEGO sensor blocks and can only be used with the SMUX. If you are using these sensors connected directly to the NXT, then you should use the standard sensor blocks that are already part of the LEGO Mindstorms software. To use them with the SMUX, simply select the NXT port number that the SMUX is connected to and then click on the small arrow next to the port numbers and then select the SMUX port number. For example, to use the Light sensor on SMUX port 1 while the SMUX is connected to port 4, the configuration panel should look like this:
Using the sensor though the SMUX with the Wait, Loop, and Switch blocks
You can also use the sensors connected through the SMUX directly with the Wait, Loop and Switch blocks. In the list of sensors that are available for these blocks you will see the new HiTechnic blocks as well as the new SMUX LEGO blocks. For example, if you want to Wait for a Touch sensor to get pressed that is connected through the SMUX, put a Wait block in your program and then in the configuration panel, make sure Control: is set to Sensor then set Sensor: to SMUX Touch Sensor. You will then need to set the port numbers. First set the NXT port number that the SMUX is connected to next to NXT -> MUX: and then click on the small arrow and select the SMUX port next to MUX -> Sensor:. For example, here are the configuration panel views of the Wait block set to wait until the Touch Sensor, which is connected to NXT port 4/SMUX port 3, is pressed.
Again, note that pressing the small arrow on the port line of the configuration panel will toggle between the two port groups.
Data logging with the HiTechnic Sensors
The new HiTechnic sensor blocks add support for this feature in the Education Edition of the LEGO Mindstorms Software. After the HiTechnic sensor blocks have been imported using the Block Import/Export wizard of the LEGO Mindstorms software, you will find these HiTechnic sensors listed among the sensors that can be logged. With all four of the new HiTechnic sensor blocks imported, this is what the sensor list looks like in the Experiment Configuration Panel: