Witam!!! Mam pytanko w dosc popularnym temacie na forum ale tego co potrzebuje konkretnie nie znalazłem. Czy udało sie komus opanowac opsługę rc5 w baskomie tak zeby działało na przerwanie tak jak w tym programie ktory znalazłem na forum, ale niestety podobnie jak u kolegi u ktorego znalazłem to w temacie umnie tez sie wiesza!!!
kod:
$regfile = "m8def.dat"
$crystal = 1000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portd.6 , Db5 = Portd.5 , Db6 = Portb.7 , Db7 = Portb.6 , E = Portd.7 , Rs = Portb.0
Cursor Off
Config Int0 = Low Level
Config Rc5 = Pind.2
On Int0 Pobr_rc5
Dim Address As Byte
Dim Address1 As Byte
Dim Command As Byte
Dim Command1 As Byte
Enable Interrupts
Enable Int0
Address1 = 255
Command1 = 255
Cls
Do
Locate 1 , 1
Lcd "Adres: " ; Address1 ; " "
Locate 2 , 1
Lcd "Komenda: " ; Command1 ; " "
Enable Int0
Loop
End
Pobr_rc5:
Disable Int0
Enable Interrupts
Getrc5(address , Command)
Command = Command And &B01111111
If Address < 255 Then
Address1 = Address
Command1 = Command
End If
Return
Czy komuś udała sie opanowac ten problem w bascomie!!! Pozdrawiam
kod:
$regfile = "m8def.dat"
$crystal = 1000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portd.6 , Db5 = Portd.5 , Db6 = Portb.7 , Db7 = Portb.6 , E = Portd.7 , Rs = Portb.0
Cursor Off
Config Int0 = Low Level
Config Rc5 = Pind.2
On Int0 Pobr_rc5
Dim Address As Byte
Dim Address1 As Byte
Dim Command As Byte
Dim Command1 As Byte
Enable Interrupts
Enable Int0
Address1 = 255
Command1 = 255
Cls
Do
Locate 1 , 1
Lcd "Adres: " ; Address1 ; " "
Locate 2 , 1
Lcd "Komenda: " ; Command1 ; " "
Enable Int0
Loop
End
Pobr_rc5:
Disable Int0
Enable Interrupts
Getrc5(address , Command)
Command = Command And &B01111111
If Address < 255 Then
Address1 = Address
Command1 = Command
End If
Return
Czy komuś udała sie opanowac ten problem w bascomie!!! Pozdrawiam