jak dodac dwa bajty np 1 i 2 w sposob taki aby wyszlo 12 a nie 3 chodzi mi o wynik w bajcie .... bo umiem to zrobic na stringach
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam$sim
Dim C As Byte ' liczba
Dim Cn As Byte ' wartosc wprowadzona z klawiatory niska
Dim Cw As Byte ' wartosc wartosc wprowadzana z kalwiatory wysoka
Dim Pier As Bit ' wystaw 1 jak pierwszy kalwisz
Do
C = 0
Cn = 0
Cw = 0
Break
Waitms 255
If P0.0 = 0 Then
If Pier = 0 Then
Pier = 1
C = 1
End If
Cw = 10 * C
End If
Break
If P0.1 = 0 Then
If Pier = 1 Then
Cn = 2
Pier = 0
End If
End If
Break
If P0.1 = 0 Then
If Pier = 0 Then
Pier = 1
C = 2
End If
End If
Break
If P0.1 = 0 Then
If Pier = 1 Then
Cn = 2
Pier = 0
End If
End If
Cw = 10 * C
Break
C = Cw + Cn
Break
Print C
Loop
solar1 napisał:...jak powina wygldac prawidlowo obsloga takiej klawiatory?
Sub Getkbd 'skanowanie matrycy
Set P3.4 : Set P3.5 : Set P3.6 : Set P3.7
Reset P3.4
Waitms 20
Debounce P3.0 , 0 , Kew1 '1
Debounce P3.1 , 0 , Kew2 '4
Debounce P3.2 , 0 , Kew3 '7
Debounce P3.3 , 0 , Kew4 'n
Set P3.4 : Reset P3.5
Waitms 20
Debounce P3.0 , 0 , Kew5 '2
Debounce P3.1 , 0 , Kew6 '5
Debounce P3.2 , 0 , Kew7 '8
Debounce P3.3 , 0 , Kew8 '0
Set P3.5 : Reset P3.6
Waitms 20
Debounce P3.0 , 0 , Kew9 '3
Debounce P3.1 , 0 , Kew10 '6
Debounce P3.2 , 0 , Kew11 '9
Debounce P3.3 , 0 , Kew12 't
Set P3.6 : Reset P3.7
Debounce P3.0 , 0 , Kew13 'f1
Debounce P3.1 , 0 , Kew14 'f2
Debounce P3.2 , 0 , Kew15 'f3
Debounce P3.3 , 0 , Kew16 's
Set P3.7
Waitms 20
Waitms 20
Return
End Sub
Cytat:Pytania typu: "popsuło mi się - co się mogło stać" - "leżą odłogiem"
Piotrek