السلام عليكم
قمت بعمل برنامج يحتوي على keypad و LCD باستخدام ال PIC16F877A بحيث الرقم الذي اكتبه على keypad يخرج على ال LCD
لكن لا اعلم لماذا لا تخرج اية ارقام اضغطها على ال keypad
البرنامج مكتوب بلغة الميكربيسك احتاج للمساعده
program finaltest
dim kp, cnt as byte
dim txt as string[5]
main:
cnt = 0
Keypad_Init(PORTD)
Lcd_Init(PORTB) ' Initialize LCD on PORT
Lcd_Cmd(LCD_CLEAR) ' Clear display
Lcd_Cmd(LCD_CURSOR_OFF) ' Cursor off
Lcd_Out(1, 1, "Key :")
Lcd_Out(2, 1, "Times:")
while TRUE
kp = 0
'--- Wait for key to be pressed
while kp = 0
'--- un-comment one of the keypad reading functions
kp = keypad_released
'kp = Keypad_Read
wend
Inc(cnt)
'--- prepare value for output
if kp > 10 then
kp = kp + 54
else
kp = kp + 47
end if
'--- print it on LCD
Lcd_Chr(1, 10, kp)
WordToStr(cnt, txt)
Lcd_Out(2, 10, txt)
wend
end.
|