Kód: Egész kijelölése
config portd.2 as input
config portd.3 as input
.
.
.
portd.2=1'ezt a sort torolted....:)
portd.3=1'ezt a sort is torolted....:)
Kód: Egész kijelölése
config portd.2 as input
config portd.3 as input
.
.
.
portd.2=1'ezt a sort torolted....:)
portd.3=1'ezt a sort is torolted....:)
Kód: Egész kijelölése
$regfile = "attiny2313.dat" ' specify the used micro
$crystal = 4000000 ' used crystal frequency
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
Config Lcd = 20 * 2
Config Lcdpin = Pin , Db4 = Portb.0 , Db5 = Portb.1 , Db6 = Portb.2 , Db7 = Portb.3 , E = Portb.6 , Rs = Portb.7
Config Lcdmode = Port
Dim A As Byte
Dim B As Byte
'we have dimmed a byte because we need to maintain the state of the encoder
Portd = &B1111111 ' activate pull up registers
Cls
Do
B = Encoder(pind.2 , Pind.3 , Links , Rechts , 1)
' ^--- 1 means wait for change which blocks programflow
' ^--------^---------- labels which are called
' ^-------^---------------------------- port PINs
Lowerline
Lcd "B" ; B
Waitms 10
Loop
End
Links:
Upperline
Incr A
Lcd " left rotation" ; A
Return
Rechts:
Upperline
Decr A
Lcd "right rotation" ; A
Return
End