hardware
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#include<stdio.h>
|
||||
#include "NUC1xx.h"
|
||||
#include "Driver\DrvGPIO.h"
|
||||
#include "Driver\DrvSYS.h"
|
||||
#include "NUC1xx-LB_002\LCD_Driver.h"
|
||||
#include "NUC1xx-LB_002\Scankey.h"
|
||||
|
||||
int main(void){
|
||||
int32_t key_press;
|
||||
char text[16];
|
||||
|
||||
UNLOCKREG();
|
||||
DrvSYS_Open(48000000);
|
||||
LOCKREG();
|
||||
|
||||
Initial_panel();
|
||||
clr_all_panel();
|
||||
OpenKeyPad();
|
||||
|
||||
print_lcd(0, "Keypad test: ");
|
||||
while(1){
|
||||
key_press = Scankey();
|
||||
if(key_press!=0){
|
||||
sprintf(text, "Key pressed: %d", key_press);
|
||||
print_lcd(1, text);
|
||||
}else{
|
||||
print_lcd(1, "press a key...");
|
||||
}
|
||||
DrvSYS_Delay(50000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user