You are on page 1of 1

'Program 7 Segment

'Keypad

'Deklarasikan Header
$regfile = "m16def.dat"
$crystal = 16000000

Config Portc = Output


Config KBD = Portd
Dim keypad as Byte
Do
keypad = getkbd()
If keypad <> 16 then
Gosub Display_segment
waitms 350
End IF
Loop
End
Display_segment:
Select case keypad
Case 19 : Portc = 192
Case 0 : Portc = 249
Case 4 : Portc = 164
Case 8 : Portc = 176
Case 1 : Portc = 153
Case 5 : Portc = 146
Case 9 : Portc = 130
Case 2 : Portc = 248
Case 18 : Portc = 128
Case 10 : Portc = 144
Case 3 : Portc = 0
Case 11 : Portc = 0
end SELECT
Return
End

You might also like