4.4 How to Add These Files
Before using chapter4.2 file, please refer to the following steps.
Create a new project.
Copy .c file to project document.
Add .c file to project.
Add all needed .c files to project.
4.5 Usage Demo
Following table is an example on how to use this C file. Process_Control() is a user-defined
function which transfers the C file of ADC when user wants to use ADC, the C file of I2C
when the user wants to use I2C, and the C file of RTC when the user wants to use RTC.
ADC0_Init();
UART_init();
EXT_Init();
Init_LCD();
TBT_Init();
Init_EEProm();
while(1)
{
ADCTempSwitKey();
Process_Control();
library
LCD_LigON_NUM(0,2);
}
EV BOARD MB2146-450-E V1.3
Chapter 4 Sample Code Manual
MCU-AN-500072-E-13 – Page 37
// initialize ADC
// initialize UART
// initialize Interrupt
// initialize LCD
// initialize Timebase timer
// initialize EEPROM
// Judge key value
// transfer every
// display LCD