Skip to content

How to change the default tiemout?

J.Rodrigo edited this page Sep 28, 2015 · 2 revisions

Default TimeOut is 3000 µs = 50cm

Ultrasonic ultrasonic(9,8); // (Trig PIN,Echo PIN)

Custom TimeOut

Ultrasonic ultrasonic(9,8,3000); // (Trig PIN,Echo PIN, Max.TimeOut in µsec )

TimeOut calculation

TimeOut = Max.Distance(cm) * 58

Example: 50 cm * 58 = 2900 µs

TimeOut = Max.Distance(inc) * 148

Example: 25 inc * 148 = 3700 µs

Clone this wiki locally