Issue with global values

Hello,

I’m stuck in my code here. I defined 2 global variables (countLeft and countRight) Strangte thing is that depending where I am in my code flow, the value is NOT always the same. I have attaced my fiull code here.

Any idea what I am doing wrong ? (See also serial debug)

Apprectaie yoiur help !!

Tony

SmartCarUltraSonicTest.ino (3.86 KB)

Debug.txt (977 Bytes)

/*
 * RESET() & STOP()    ----> parameterless.
 * all other functions ----> (speed,TotalTime,BlinkTime)
 */
  int countLeft = 0;
  int countRight = 0;

These redefinitions hide the global values and are reset to zero in each loop iteration.

Post your code as instructed in Item #6 here: Read this before posting a programming question ...

Perhaps the site devs can block ino c and h files from being attached when within the inline posting limit ?

lastchancename:
Perhaps the site devs can block ino c and h files from being attached when within the inline posting limit ?

Wouldn't that be great?

Oh my God .... So ashamed ! This was old leftover code ..

Thanks Mate !!!