How to use setTimeout to adjust RC timeout of QTR sensor

In the comments for the example QTR code is says the RC timeout can be adjusted with “setTimeout()”. If someone can show me how that is implemented I would appreciate it.

Hello.

You can simply call setTimeout() with the argument specifying the new timeout in microseconds; for example, to set the timeout to 1000µs, it would look something like this:

qtr.setTimeout(1000);

You can find more information about the setTimeout() in the library’s documentation for that function. As noted there, we generally recommend setting it between 1000µs and 3000µs.

Brandon

Oh thanks. I missed the detail of adding “qtr” as a prefix.

1 Like