سلام دوستان ،من قراره خیره سرم کد کلید های یک ریموت کنترل بخونم.کد زیر رو نوشتم.جواب میده ولی هردفه جوابش متغیره.اساتید یکی یه کمکم بکن
کد:
$regfile = "m16def.dat" ' specify the used micro $crystal = 2000000 ' used crystal frequency $baud = 9600 ' use baud rate Config Lcdpin = Pin , Db4 = Portb.3 , Db5 = Portb.2 , Db6 = Portb.1 , Db7 = Portb.0 , E = Portb.4 , Rs = Portb.6 Config Lcd = 16 * 2 Config Lcdbus = 4 Config Portb = Output Config Portd = Input Config Pina.0 = Input Dim L(10) As Byte Dim A As Byte A = 0 Lcd "sallam" Waitms 1000 Cls Do Do L(a) = waitkey() Waitms 5 Incr A Loop Until A = 9 Lcd L(a) ; "," ; L(a + 1) ; "," ; L(a + 2) ; "," ; L(a + 3) Locate 2 , 1 Lcd L(a + 4) ; "," ; L(a + 5) ; "," ; L(a + 5) ; "," ; L(a + 7) Wait 2 Cls Loop En
دیدگاه