[Dprglist] Arduino Code Troubles

Pat Caron patcaron at mail.com
Fri Dec 17 12:24:15 PST 2021


Hi David, I did try replacing maxDistance with a static value == 200
It didn't make a difference.
...Pat C.

On Fri, Dec 17, 2021 at 3:16 PM David P. Anderson via DPRGlist <
dprglist at lists.dprg.org> wrote:

> Pat,
>
> On 12/17/21 11:08 AM, markus via DPRGlist wrote:
> > uint16_t maxDistance = 200; // Also used with NewPing.h libraray
>
> What does this mean, also used with NewPing.h library.  If you replace
> that with a constant does it make any difference?
>
> I.e.,
>
>      if ((cm[x] == 0) or (cm[x] > maxDistance)) {
>        cm[x] = 999;
>      }
>
> becomes
>
>      if ((cm[x] == 0) or (cm[x] > 200)) {
>        cm[x] = 999;
>      }
>
> ???
>
> _______________________________________________
> DPRGlist mailing list
> DPRGlist at lists.dprg.org
> http://lists.dprg.org/listinfo.cgi/dprglist-dprg.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dprg.org/pipermail/dprglist-dprg.org/attachments/20211217/43905ac3/attachment.html>


More information about the DPRGlist mailing list