• HiTechnic NXT Touch Sensor Multiplexer

HiTechnic NXT Touch Sensor Multiplexer for LEGO Mindstorms NXT

Introduction

The NXT Touch Sensor Multiplexer allows up to 4 touch sensors to be connected to a single NXT sensor port. An NXT program can read the state of each touch sensor or the state of all 4 touch sensors with a single read command.

Programming

Mindstorms NXT-G

This block checks each of the touch sensors connected to the Touch Sensor Multiplexer and sends out its result as logic signals (true or false) through data wires. If a touch sensor has been triggered, the block will send out a true signal; if it has not been triggered, the block will send a false signal. Use the radio buttons to decide which state each touch sensor or switch has to be in to produce an overall logic "true" signal.

You must drag at least one output data wire from this block's data hub to another block for any information to be sent.

The term Multiplexer is often shortened to "MUX".

Note: The Touch Sensor MUX only works with Touch Sensors. If other types of sensors are plugged into the Touch MUX they will not operate.

Display Settings

Image of block

  1. The number shows which NXT port is connected to the Touch Sensor Multiplexer. You can change this number in the configuration panel if you need to.
  2. The block's data hub will open automatically when the block is placed in the work area. At least one data wire must be dragged from the block's output plug to another block's data hub. (See the Data Hub section below for more information.)

Configuring the Touch Sensor Multiplexer Block

Image of configuration panel

  1. Choose the NXT port your Touch MUX is plugged into. By default, the block will be set to port 2 for a Touch Sensor Multiplexer. You can change this selection if you need to.
  2. Select the desired combination of Touch Sensor inputs that will be combined to create the overall logic output. In the default state, all four Touch Sensors must be triggered to create an overall true output. If a Touch Sensor input is not needed to contribute toward the overall logic output, then Ignore should be selected. If a Touch Sensor input is needed but in the untriggered state to contribute toward the overall logic output, then False should be selected.

    For example, with the setting shown in the following front panel, the overall logic output will be set to True when

    Touch Sensor 1 is pressed (True)
    and
    Touch Sensor 2 is not pressed (False)
    and
    Touch Sensor 3 is pressed (True)
    and
    Touch Sensor 4 is ignored (don't care if it is pressed or not)

Image of configuration panel

Touch MUX block Data Hub plugs
The connections to the Touch Sensor Multiplexer are mechanically configured as follows;

The connector identified by the "NXT" label should be wired to the desired NXT sensor port.

Up to four Touch Sensors can be wired to the connectors labeled 1 - 4.

This chart shows the different characteristics of the plugs on the Touch MUX block's data hub:

 

Plug

Data Type

Possible Range

What the Values Mean

Port

Port

Number

1 - 4

1 = Port 1, 2 = Port 2, 3 = Port 3, 4 = Port 4

Max/Min

Switch1

Logic

True/False

True = Touch Sensor pressed 
False = Touch Sensor not pressed

Max/Min

Switch2

Logic

True/False

True = Touch Sensor pressed 
False = Touch Sensor not pressed

Max/Min

Switch3

Logic

True/False

True = Touch Sensor pressed 
False = Touch Sensor not pressed

Max/Min

Switch4

Logic

True/False

True = Touch Sensor pressed 
False = Touch Sensor not pressed

Max/Min

Raw Value

Number

0 - 15

Raw (unscaled) value from the Touch MUX

Max/Min

Yes / No

Logic

True/False

Compare table result

Max/Min

Entry1

Number

0 - 2

Switch 1 Compare entry 
0=Select True, 1=Select False, 2 = Select Ignore

Max/Min

Entry2

Number

0 - 2

Switch 2 Compare entry 
0=Select True, 1=Select False, 2 = Select Ignore

Max/Min

Entry3

Number

0 - 2

Switch 2 Compare entry 
0=Select True, 1=Select False, 2 = Select Ignore

Max/Min

Entry4

Number

0 - 2

Switch 2 Compare entry 
0=Select True, 1=Select False, 2 = Select Ignore

To decode the touch sensor status based on the raw sensor value, here is the code fragment:

SetSensorType(S1, SENSOR_TYPE_LIGHT);
long value, switches;
bool switch1,switch2,switch3,switch4;
value=1023-SensorRaw(S1);
switches=339*value;
switches/=1023-value;
switches+=5;
switches/=10;
if(switches&8) switch4=1; else switch4=0;
if(switches&4) switch3=1; else switch3=0;
if(switches&2) switch2=1; else switch2=0;
if(switches&1) switch1=1; else switch1=0;
Other Programming Environments

NXC

The Touch Sensor Multiplexer can be read in an NXC program using the function ReadSensorHTTouchMultiplexer. Here is a complete sample program:

//============================================================
// HiTechnic sample program for the T-MUX
//
// This program uses the function ReadSensorHTTouchMultiplexer
// to get the state of the touch sensors attached to the T-MUX.
#define PORT_TMUX IN_1
task main()
{
  bool t1,t2,t3,t4;
  
  SetSensorType(PORT_TMUX, IN_TYPE_LIGHT_INACTIVE);
  TextOut(0, LCD_LINE1, "HiTechnic");
  TextOut(0, LCD_LINE2, "  TMUX Viewer");

  while(true) {
    ReadSensorHTTouchMultiplexer(PORT_TMUX, t1, t2, t3, t4);
    TextOut(0, LCD_LINE5, "                "); // Erase line
    if (t1) TextOut(6,    LCD_LINE5, "T1");
    if (t2) TextOut(6*5,  LCD_LINE5, "T2");
    if (t3) TextOut(6*9,  LCD_LINE5, "T3");
    if (t4) TextOut(6*13, LCD_LINE5, "T4");
    Wait(10);
  }
}
More information regarding NXC is available at http://bricxcc.sourceforge.net/nbc/.

LabVIEW Toolkit vi

The Touch Sensor Multiplexer is supported from the NXT LabVIEW Toolkit. A vi is available for download from the Download page.

n

More information on LabView for MINDSTORMS is available at http://www.ni.com/academic/mindstorms/

 

RobotC

task main()
{
SensorType[S3] = sensorHiTechnicTouchMux; // Configure the sensor.

 

while (true)
{
int nButtonsMask;

//
// The sensor value is a 4-bit map indicating which of the possible four
// touch sensors are pressed.
//
nButtonsMask = SensorValue[S3];

if (nButtonsMask & 0x01)
nxtDisplayTextLine(1, "Btn 1: Pressed");
else
nxtDisplayTextLine(1, "Btn 1:");

if (nButtonsMask & 0x02)
nxtDisplayTextLine(2, "Btn 2: Pressed");
else
nxtDisplayTextLine(2, "Btn 2:");

if (nButtonsMask & 0x04)
nxtDisplayTextLine(3, "Btn 3: Pressed");
else
nxtDisplayTextLine(3, "Btn 3:");

if (nButtonsMask & 0x08)
nxtDisplayTextLine(4, "Btn 4: Pressed");
else
nxtDisplayTextLine(4, "Btn 4:");
wait1Msec(100);
}
}

 

For more information go to http://www.robotc.net/content/lego_over/lego_over.html.

 

Write a review

Please login or register to review

HiTechnic NXT Touch Sensor Multiplexer

  • Brand: HiTechnic
  • Product Code:Hitechnic-NXT-Touch-Sensor-Mux
  • Reward Points:36
  • Availability:In Stock
  • रo 4,259.80

  • Ex Tax:रo 3,610.00
  • Price in reward points:3610

Related Products

Lego Mindstorm Acceleration / Tilt Sensor for NXT / EV3

Lego Mindstorm Acceleration / Tilt Sensor for NXT / EV3

Now you can make robots that know which way is up! The Accelerometer / Tilt Sensor measures accelera..

रo 8,165.60 रo 8,909.00 Ex Tax:रo 6,920.00

Lego Mindstorms Magnetic Compass Sensor for NXT / EV3

Lego Mindstorms Magnetic Compass Sensor for NXT / EV3

Expand your NXT experiences with the new NXT Compass Sensor and add accurate navigation to your Mind..

रo 8,714.30 रo 8,909.00 Ex Tax:रo 7,385.00

Lego Mindstorms Infrared Seeker V2 for NXT / EV3

Lego Mindstorms Infrared Seeker V2 for NXT / EV3

Play robot soccer and zero in on your infrared (IR) beacons with IRSeeker. You can use most TV remot..

रo 8,165.60 रo 8,242.30 Ex Tax:रo 6,920.00

Lego Mindstorms Color Sensor V2 for NXT / EV3

Lego Mindstorms Color Sensor V2 for NXT / EV3

Add a spectrum of color to your models with the new and updated Color Sensor. Detect an extended ran..

रo 8,165.60 रo 8,909.00 Ex Tax:रo 6,920.00

PICAXE I2C Explorer Kit AXE216

PICAXE I2C Explorer Kit AXE216

A self-assembly kit for the PICAXE-20X2 (included) for those wishing to interface and experiment wit..

रo 1,593.00 Ex Tax:रo 1,350.00

BrickPi+ Base Kit

BrickPi+ Base Kit

BrickPi is best for someone who already has LEGO MINDSTORMS sensors and motors. The BrickPi connects..

रo 20,724.34 Ex Tax:रo 17,563.00

EV3 Infrared Beacon

EV3 Infrared Beacon

This has been designed for use with the EV3 Infrared Seeker Sensor. The beacon emits an infrared sig..

रo 5,221.50 Ex Tax:रo 4,425.00

EV3 Infrared Sensor

EV3 Infrared Sensor

The digital EV3 Infrared Seeking Sensor detects proximity to the robot and reads signals emitted by ..

रo 5,221.50 Ex Tax:रo 4,425.00

EV3 Color Sensor

EV3 Color Sensor

The digital EV3 Color Sensor distinguishes between eight different colors. It also serves as a light..

रo 6,106.50 रo 6,944.30 Ex Tax:रo 5,175.00

EV3 Ultrasonic Sensor

EV3 Ultrasonic Sensor

The digital EV3 Ultrasonic Sensor generates sound waves and reads their echoes to detect and measure..

रo 5,221.50 Ex Tax:रo 4,425.00

EV3 Gyro Sensor

EV3 Gyro Sensor

The digital EV3 Gyro Sensor measures the robot’s rotational motion and changes in its orientation. S..

रo 5,221.50 Ex Tax:रo 4,425.00

Lego Mindstorms NXT Magnetic Sensor

Lego Mindstorms NXT Magnetic Sensor

The NXT Magnetic Sensor will enable you to build robots that can detect magnetic fields. The sensor ..

रo 3,380.70 Ex Tax:रo 2,865.00

Lego Mindstorms NXT IR Receiver Sensor

Lego Mindstorms NXT IR Receiver Sensor

The NXT IRReceiver Sensor receives signals from a LEGO Power Functions IR remote control, decodes th..

रo 7,410.40 Ex Tax:रo 6,280.00

Lego Mindstorms NXT EOPD

Lego Mindstorms NXT EOPD

Accurately detect objects and small changes in distance to a target with the HiTechnic EOPD. The EOP..

रo 8,165.60 Ex Tax:रo 6,920.00

Lego Mindstorms NXT Angle Sensor

Lego Mindstorms NXT Angle Sensor

Measure axle rotation position and rotation speed with the HiTechnic Angle Sensor. The Angle Sensor ..

रo 8,165.60 Ex Tax:रo 6,920.00

Lego Mindstorms NXT Barometric Sensor

Lego Mindstorms NXT Barometric Sensor

The NXT Barometric Sensor can be used as part of a weather station or to monitor altitude. The senso..

रo 8,165.60 Ex Tax:रo 6,920.00

HiTechnic NXT SuperPro Prototype Board

HiTechnic NXT SuperPro Prototype Board

HiTechnic SuperPro Sensor for LEGO Mindstorms NXT Introduction The HiTechnic SuperPro Sensor..

रo 4,012.00 Ex Tax:रo 3,400.00

Tags: HiTechnic, NXT, Touch, Sensor, Multiplexer

The product is currently Out-of-Stock. Enter your email address below and we will notify you as soon as the product is available.

Name
Email
Phone
Comments