How to manage QTR_NO_EMITTER_PIN?

Hi Everyone,

I enjoy Zumo Robot for Arduino ver1.2.

I used “LineSensorTest” example to examine QTR_NO_EMITTER_PIN.

I want to use D2 pin (Emitter Pin: Arduino Uno) for alternate purposes:

for example, slide switch).

Could you teach me how to use D2 pin for other purpose ?

I want to know how to use “reflectanceSensors.init(QTR_NO_EMITTER_PIN);”.

I tried test codes (Case a and b). QTR_NO_EMITTER_PIN dose not work.

(1) program

void setup()

{

// Initialize the reflectance sensors module

byte pins[] = {4, A3, 11, A0, A2, 5};

reflectanceSensors.init(pins, 6,2000, QTR_NO_EMITTER_PIN );

// reflectanceSensors.init(QTR_NO_EMITTER_PIN);

(2) Results (serial monitor)

Code a

reflectanceSensors.init(pins, 6, 2000); <==== without QTR_NO—

<>

1052 852 1740 2000 1268 1224 E

1052 848 1736 2000 1300 1216 E

1052 848 1736 2000 1308 1220 E

1052 844 1732 2000 1304 1220 E

Code b

reflectanceSensors.init(pins, 6,2000, QTR_NO_EMITTER_PIN );

<>

2000 2000 2000 2000 2000 2000 E

2000 2000 2000 2000 2000 2000 E

2000 2000 2000 2000 2000 2000 E

2000 2000 2000 2000 2000 2000 E

Thank you

Hello.

Can you confirm you are using the “LineSensorTest.ino” example program from the latest version of our Zumo Shield Arduino Library (version 2.1.0)?

To set up your reflectance sensor code to not use an emitter pin you should just have to change the initialization function in line 30 from the default reflectanceSensors.init(); to reflectanceSensors.init(QTR_NO_EMITTER_PIN); (presuming that you have not made any other changes to the reflectance sensor array). Then you need to remember to remove the shorting block on your Zumo’s reflectance sensor array; did you do that when your ran code b?

- Patrick

Thank you, Patrick.
It worked fine. I was fluttering about other things with Zumorobo, and the answer was delayed.