Never mind, 0 - 1 = 65535 with unsigned int. Which is >=0, so weird stuff happens as out of bounds locations are accessed.
Changed to signed int, now 0 -1 = -32767 or -32768 and it continues correctly.
CrossRoads:
Never mind, 0 - 1 = 65535 with unsigned int. Which is >=0, so weird stuff happens as out of bounds locations are accessed.
Changed to signed int, now 0 -1 = -32767 or -32768 and it continues correctly.
The warnings from the compiler should have been a hint:
sketch_dec26a.ino:11:17: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
for (x = 7; x >= 0; x = x - 1)
~~^~~~
sketch_dec26a.ino:15:17: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
for (x = 7; x >= 0; x = x - 1)
~~^~~~