It is relatively straightforward to debug Spin code. You can insert commands to print the value of variables to the terminal. This is a time-honored way to debug code, and though tedious, it works. In Listings 11-1 and 11-2, I show how I monitor the value of a variable.
Debugging Spin Code with Print Commands
Insert print statements like this in your Spin code, and you can examine the value of ...