All Mowers - Basic Arduino
Basic Arduino Skills:
You don't need to have any in depth programming skills to build a successful mower project. Most of the settings and testing can be done directly using the mower keypad and LCD screen, but some basic skills with the Arduino IDE are required.
Here are some basic functions of the Arduino IDE that will be required.
Loading a "sketch".
Sketches are the Arduino term for a program of code. There are 2 main parts of the code.
1. Setup - code is ran once only at the beginning
2. Loop - code is continuously ran in an infinite loop starting from the top and running to bottom, then "looping" back to the top and running again.
Any text which is proceeded by // means everything after the // is just for information and has no functional use in the code. This is used to comment code so that people can understand what the programmer is doing and that the programmer can also understand what was the point of the code at a later date :)
Selecting the Correct Arduino Board
To upload the code to the board you must select the correct board type (MEGA or UNO or Nano or ....) and the correct port its located on. The board is connected to the computer via a USB cable and the code is uploaded through the USB cable to the boards memory.
Uploading the Sketch
Once the board is connected, the sketch can be uploaded using the button shown here. The serial monitor shows output from the board when the USB cable is attached. With a Serial.print(" "); command, text can be sent to the serial monitor so the running sketch can be monitored. This is very useful in debugging code and understanding whats going on in the sketch.
Confirming the sketch is uploaded.
Once the code is uploaded, the Arduino IDE will confirm the upload.
Normally you should see white text showing how much space on the Arduino board has been used by the sketch. (For a NODEMCU board this may look a little different as the upload procedure is different)
Some Common Errors
No such file or directory - A Library file is missing which the Arduino IDE needs to know what a command means
error; 'perimeter' was not declared in this scope - A Library file is missing which the Arduino IDE needs to know what a command means
see here for the libraries which need to added to the Arduino IDE
Error compiling for board NodeMCU 1.0 - Wrong board is selected or the board has not been added to the Arduino IDE.
Serial port 'COM 3' not found - The wrong port has been selected for the board