Wireless debugging is an immensely useful tool for troubleshooting. Without it, your chances of success are slim. Although these modifications to your code may look daunting and time consuming, they will almost certainly save you time in the long run.
To add wireless debugging to your espMouse, you must first add the following libraries somewhere toward the top of your program (to the file that ends with a .ino).
Below your include statements add these lines to define the SSID and Password. Change the SSID and password so they match what you used when you created your web app to remotely control your robot.
Somewhere in your variables section add
Insert these as the first lines within
Within the while loop for your button add the following below your
In order to send information to the device you plan to use to wirelessly debug your espMouse, you'll need to add the
The pages that will be served by your espMouse to relay debugging information are defined using the following functions. Add them at the very end of your program.
The espMouseMaze.h library uses the same debugMessage variable to relay information wirelessly from the
Now you are ready to test whether all of the changes you have made work. Add the following lines below the button while loop within the
When you connect to your robot's WiFi signal and navigate to 192.168.4.1, the words "Hello World" should appear.
You can debug your robot simply by passing whatever information you want to the debugMessage variable. For example, to see the values calculated during calibration, add the following to the bottom of your