$crystal = 4000000 'deklaracja częstotliwości pracy kwarcu
$regfile "attiny2313.dat" 'model procesora dla którego jest ten program
Deflcdchar 1 , 14 , 17 , 17 , 14 , 32 , 32 , 32 , 32 ' definicja znaki stopnia
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Pd.6 , Db5 = Pd.3 , Db6 = Pd.4 , Db7 = Pd.5 , E = Pd.1 , Rs = Pd.0
Cursor Off
Cls
Dim Kod As Bit
Dim Command As Byte , Subaddress As Byte
Reset Portd.2
On Int0 Receiverc5
Enable Int0
Enable Interrupts
Cls
Lcd "Waiting for RC5"
Cursor Off
Do
If Kod = 1 Then
Disable Int0
Cls
Lcd "Com: " ; Command ; ",Adr: " ; Subaddress
Kod = 0
Enable Int0
End If
Loop
Receiverc5:
Getrc5(Subaddress , Command)
Kod = 1
Return
End
wielkie dzieki, zadzialalo, teraz problem z rc5 ;]
COM:255 Adr: 25
reaguje na pilota bo mryga wyswietlacz
Dodano po 11 [minuty]: Poradzilem sobie ;>
$crystal = 4000000 'deklaracja częstotliwości pracy kwarcu
$regfile "attiny2313.dat" 'model procesora dla którego jest ten program
Deflcdchar 1 , 14 , 17 , 17 , 14 , 32 , 32 , 32 , 32 ' definicja znaki stopnia
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Pd.6 , Db5 = Pd.3 , Db6 = Pd.4 , Db7 = Pd.5 , E = Pd.1 , Rs = Pd.0
Cursor Off
Cls
Config Rc5 = Pind.2
Dim Address As Byte , Command As Byte
Enable Interrupts
Do
Getrc5(address , Command)
Command = Command And &B01111111
Cls
Lcd "adres: " ; Address
Lowerline
Lcd "komenda: " ; Command
Waitms 100
Loop
End
na tym kodzie dziala :> jednak denerwuje mnie ta petla ;> zaraz cos pokombinuje