Menu Content/Inhalt
Home arrow Product Information arrow cball NXT Sensor arrow cballNXT Programming Using Robolab
cballNXT Programming Using Robolab

Introduction

Welcome to the Quantum Torque cballNXT using Robolab Tutorial. This document explains the process of getting your Robolab program ready for use with the cballNXT then how to read the sensor values in your program. This guide is available as a pdf at: http://www.quantumtorque.com/media/robolab-cballnxt.pdf

Requirements

Please ensure the following requirements are satisfied before continuing:
  1. Robolab Version 2.9 is Installed on your Computer
  2. You have downloaded the Quantum Torque cballNXT Sensor files from http://www.quantumtorque.com/media/cballNXT Robolab Library.zip

Upgrading Robolab 2.9.4

To use the cballNXT with Robolab the latest version (2.9.4) is required:

  1. Download the Robolab update from

http://www.legoengineering.com/robolab-submenusupport-141.html

  1. Follow the installation instructions (below installer/update link)

http://www.legoengineering.com/robolab-submenusupport-141.html#howdoiinstall

Installation of cballNXT Sensor Files

The following steps will give you access to cballNXT programming blocks within Robolab:

  1. Unzip the “cballNXT_Robolab_Library.zip” files into the Robolab installation directory, the default Robolab installation directory is “C:\Program Files\Robolab29”
  2. The following files should now exist

C:\Program Files\Robolab29\Sensors\900quantumtorque_cball.sa

C:\Program Files\Robolab29\user.lib\quantum torque\qmt_cball Container.vi

C:\Program Files\Robolab29\user.lib\quantum torque\Zero qmt_cball.vi

 

Installation of cballNXT Sensor Files

The following steps will give you access to cballNXT programming blocks within Robolab:

  1. Unzip the “cballNXT_Robolab_Library.zip” files into the Robolab installation directory, the default Robolab installation directory is “C:\Program Files\Robolab29”
  2. The following files should now exist
C:\Program Files\Robolab29\Sensors\900quantumtorque_cball.sa
C:\Program Files\Robolab29\user.lib\quantum torque\qmt_cball Container.vi
C:\Program Files\Robolab29\user.lib\quantum torque\Zero qmt_cball.vi

Using the cballNXT Programming Blocks

Now you have installed all the required files you can read values from the cballNXT

Accessing the cballNXT Blocks

The cballNXT Programming Blocks can be accessed from the user libraries folder:

  • User Libraries
  • Quantum Torque  
 Image Image
 Image

 

cballNXT Blocks

The Quantum Torque library folder contains two blocks for use with the cballNXT.

The Initialize cballNXT (cball 0 Qmt) block is used once the program to setup the NXT port (1 to 4) where cballNXT is connected. Opening the Front Panel shows some information about the cballNXT and show allows selection of the default value (sensor type) to read from the sensor.

Image

The QT cballNXT Container (container symbol w/ cball) is used to read the sensor value (sensor type), selected in the Initialize cballNXT block, into a Robolab container. Using this block will also create/update ten named values/variables.

Variable Name

cballNXT Address

Meaning

Range

direction

0x40

Photo detector number with maximum

infrared signal, zero = all less than background

0 – 8

intensity

0x42

Raw reading of photo detector with

maximum infrared signal

0 – 255

detector_1

0x43

Raw readings of photo detector 1

0 – 255

detector_2

0x44

Raw readings of photo detector 2

0 – 255

detector_3

0x45

Raw readings of photo detector 3

0 – 255

detector_4

0x46

Raw readings of photo detector 4

0 – 255

detector_5

0x47

Raw readings of photo detector 5

0 – 255

detector_6

0x48

Raw readings of photo detector 6

0 – 255

detector_7

0x49

Raw readings of photo detector 7

0 – 255

detector_8

0x4A

Raw readings of photo detector 8

0 – 255

 

Image

Example Program

The following diagram show the example program available at

http://www.quantumtorque.com/media/cballNXT Robolab Example.zip

Image 

  1. NXT Program call block, program name will appear on NXT as “cball NXT”.
  2. Start of loop block.
  3. Initialize cballNXT on NXT sensor port 1 (sensor type selected to direction).
  4. Read the “direction” value from the cballNXT and place in the yellow container.
  5. Move the named values “direction” into the red container.
  6. Move the named values “intensity” into the blue container.
  7. Display the named values “detector_1” and “detector_2” values on NXT screen.
  8. Display the named values “detector_3” and “detector_4” values on NXT screen.
  9. Display the named values “detector_4” and “detector_6” values on NXT screen.
  10. Display the named values “detector_7” and “detector_8” values on NXT screen.
  11. Display the named values “direction” and intensity” values on NXT screen.
  12. End of loop block.
  13. NXT Program end block.