double telecommande IR et RF

margamas

Member
bonsoir
j'ai une del à alumer avec 2 télécommandes : une infra-rouge et une radio.

j'arrive à faire fonctionner chacune des télécommandes avec des programmes différents mais je n'arrive pas à faire un programme unique qui fonctionne avec les 2 télécommandes à la fois



Code:
#picaxe 14M2

Do

rfin C.1,b1,b1,b1,b1,b1,b1,b1,b1
if b1 = 16 then
	
	toggle B.1
	pause 200	
else 
	irin C.0,b0
	if b0 = 16 then
	toggle B.1
	pause 200
        end if

end if
	
loop
avec le code ci-dessus seule la commande RF fonctionne
 

MGU

Senior Member
Bonjour,

C'est normal, ces deux commandes sont bloquantes.
C'est à dire que la commande rfin attend de recevoir un signal et la commande IR ne fonctionne pas.
Ou c'est l'IR qui attend et le rfin ne fonctionne pas. Le temps d'attente de IRin peut être limité par le timeout.

Solution, un picaxe pour chaque et une porte à diode pour la led.

ou:
Note this command is blocking, no other commands will process whilst the rfin command is waiting for RF data to be received. If a system that can process other commands whilst waiting for data to be received is required, the NKM2401 should be used as a dedicated slave receiver alongside the PICAXE chip. This allows the NKM2401 to receive and store the data at any time, so that the PICAXE chip can then read the data as and when it is ready to do so. The NKM2401 decoder can be used with all PICAXE chips, even those that do not support the rfin command (as it uses the serin command). - See more at: http://www.picaxe.com/BASIC-Commands/Digital-InputOutput/rfin/#sthash.sPKExb0L.dpuf

MM
 

margamas

Member
bonjour
on ne peut pas mettre un timeout à rfin ?
je ne connais pas bien la commande serout à par pour l'afficheur
 
Top