Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
It'll look like this
and doesn't strip spaces out
Device = 18F1320
Clock = 8
Config OSC = INTIO2
Config MCLRE = OFF
Include "INTOSC8.bas"
Include "Utils.bas"
//Dim count As Byte
//Dim keypress As Byte
//Dim holdkey As Byte
Dim key1 As Byte
Dim key2 As Byte
Dim key3 As Byte
Dim key4 As Byte
Dim key5 As Byte
Dim key6 As Byte
Dim key7 As Byte
Dim key8 As Byte
Dim key9 As Byte
Dim key10 As Byte
Dim key11 As Byte
Dim key12 As Byte
Dim out As PORTB.3
Dim col1 As PORTA.0
Dim col2 As PORTA.1
Dim col3 As PORTA.2
Dim roll1 As PORTA.3
Dim roll2 As PORTA.4
Dim roll3 As PORTA.6
Dim roll4 As PORTA.7
SetAllDigital
Input (roll1)
Input (roll2)
Input (roll3)
input (roll4)
Output (out)
Output (col1)
Output (col2)
Output (col3)
Low (out)
While True
High (col1) Low (col2) Low (col3) // col 1
If col1 = 1 And col2 =0 And col3 = 0 And roll1 = 1 Then
key1 =1
high (out)
delayus (1400)
low (out)
delayus (700)
EndIf
High (col1) Low (col2) Low (col3)
If col1 = 1 And col2 =0 And col3 = 0 And roll2 = 1 Then
key2 =2
high (out)
delayus (1600)
low (out)
delayus (700)
EndIf
High (col1) Low (col2) Low (col3)
If col1 = 1 And col2 =0 And col3 = 0 And roll3 = 1 Then
key3 =3
high (out)
delayus (1800)
low (out)
delayus (700)
EndIf
High (col1) Low (col2) Low (col3)
If col1 = 1 And col2 =0 And col3 = 0 And roll4 = 1 Then
key4 =4
high (out)
delayus (2000)
low (out)
delayus (700)
EndIf
Low (col1) High (col2) Low (col3) // col 2
If col2 = 1 And col1 =0 And col3 = 0 And roll1 = 1 Then
key5 =5
high (out)
delayus (1400)
low (out)
delayus (600)
EndIf
Low (col1) High (col2) Low (col3)
If col2 = 1 And col1 =0 And col3 = 0 And roll2 = 1 Then
key6 =6
high (out)
delayus (1600)
low (out)
delayus (600)
EndIf
Low (col1) High (col2) Low (col3)
If col2 = 1 And col1 =0 And col3 = 0 And roll3 = 1 Then
key7 =7
high (out)
delayus (1800)
low (out)
delayus (600)
EndIf
Low (col1) High (col2) Low (col3)
If col2 = 1 And col1 = 0 And col3 = 0 And roll4 = 1 Then
key8 =8
high (out)
delayus (2000)
low (out)
delayus (600)
EndIf
Low (col1) Low(col2) High (col3) // col 3
If col3 = 1 And col1 =0 And col1 = 0 And roll1 = 1 Then
key9 =9
high (out)
delayus (1400)
low (out)
delayus (500)
EndIf
Low (col1) Low (col2) High (col3)
If col3 = 1 And col2 =0 And col1 = 0 And roll2 = 1 Then
key10 =10
high (out)
delayus (1600)
low (out)
delayus (500)
EndIf
Low (col1) Low (col2) High (col3)
If col3 = 1 And col2 =0 And col1 = 0 And roll3 = 1 Then
key11 =11
high (out)
delayus (1800)
low (out)
delayus (500)
EndIf
Low (col1) Low (col2) High (col3)
If col3 = 1 And col2 =0 And col1 = 0 And roll4 = 1 Then
key12 =12
high (out)
delayus (2000)
low (out)
delayus (500)
EndIf
Wend