### User Tools

The bootloader is quite easy to use as a class for programming. First, instantiate a bootlaoder object with the appropriate HEX file path, serial port path, and baud rate (Note: If not using a custom bootloader, use a baud rate of 115200, default). The Bootloader class provides a number of functions to interract with the microcontrollers memory. A call to the loadHex() function will initialize the hex file for transmission - this does not need to be done, as the file will be loaded automatically when the program function is called. Therefore, only a small number of functions are needed from the Bootloader class. These include erase(), program(), and start(). These functions are quite explanatory, but they will be discussed anyways. The erase function will erase all memory pages within the microcontroller that are not in use by the bootloader. The erase function must be called when loading a new program into the microcontroller to ensure that the memory space is not already occupied. If there is residual data there, the program will be copied on top of it, and will not function as intended. The program function can be used for programming the microcontroller with the specified hex file. This function will load the hex file and transmit it record by record until the microcontroller program is complete. The start function is what triggers the microcontroller to begin execution of the bootloaded program. Without a call to start, the microcontroller will remain in the bootloading mode and new files can be loaded onto it. Calling start will cause the microcontroller to jump to the start of the bootloaded program.