'************************************************************ '* Projet - Emeteur Recepteur - Groupe 2 - TS-3 * 2003/2004 * '************************************************************ '* BESNARD Romain * '* BOURSE Cedric * '* HENAFF Ivan * '********************************************************* '* Programmation par Orion_ [2003] (a.k.a Cedric BOURSE) * '********************************************************* '* Programme Basic 11 pour la base, Version alpha. * '*************************************************** #include "startrf1.bas" byte t2,t,a byte value,a0,a1,a2,a3 // 0000000001111111 // 1234567890123456 a0=1 a1=0 a2=1 a3=1 ' Boucle principale do a = 180-(6*4)-16 ' precalcul if a0 = 1 then a=a-16 PORTA.5=1 delaims1(16) PORTA.5=0 delaims1(4) else a=a-6 PORTA.5=1 delaims1(6) PORTA.5=0 delaims1(4) end if if a1 = 1 then a=a-16 PORTA.5=1 delaims1(16) PORTA.5=0 delaims1(4) else a=a-6 PORTA.5=1 delaims1(6) PORTA.5=0 delaims1(4) end if if a2 = 1 then a=a-16 PORTA.5=1 delaims1(16) PORTA.5=0 delaims1(4) else a=a-6 PORTA.5=1 delaims1(6) PORTA.5=0 delaims1(4) end if if a3 = 1 then a=a-16 PORTA.5=1 delaims1(16) PORTA.5=0 delaims1(4) else a=a-6 PORTA.5=1 delaims1(6) PORTA.5=0 delaims1(4) end if PORTA.5=1 ' signal 5 delaims1(16) PORTA.5=0 delaims1(4) PORTA.5=1 ' fin de trame delaims2(a) PORTA.5=0 delaims2(4) loop '****************************************************************************** decodevalue: value=0 if PORTE.1=1 then value=value+1 end if if PORTE.3=1 then value=value+2 end if if PORTE.4=1 then value=value+4 end if if PORTE.5=1 then value=value+8 end if return '******************************* CUSTOM DELAY ******************************** function delaims1(t1) ' pour tempo < 2ms for t = 1 to t1 for t2 = 1 to 4 next t2 next t end function function delaims2(t1) ' pour tempo > 2ms for t = 1 to t1 for t2 = 1 to 5 next t2 next t end function