MCU Examples.com
PIC Microcontroller Project Examples, free source codes and resources collection.
Flow chart for the main program of the microcontroller is presented bellow. Apart from the main program macros had been used, which significantly reduces the program length and also simplifies the code dramatically. Following are the macros that were used for coding of the prototype;
Scankeypad.inc
Once this macro is called it would scan the 4x4 matrix and bits would be assigned for sixteen buttons to two variables, each bit is unique for a particular button. The key could be identified by determining which bit is set.
Macro.inc
This macro would be used to give a time interval between functions in ms to pause the program without executing any operation.
Rotate.inc
This macro contains the function which controls the pulse given to the stepper motor. Once the macro is called it would only give out one pulse to the stepper motor ensuring more accuracy when rotation takes place.
EEPROM.inc
This macro would be used to both read and write data to the EEPROM which would enable to resume the program from previously stopped antenna location and save desired antenna locations without data loss during a hard reset.