In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Jean Brunet wrote: Hello, I search to transmit 4 bytes to a Sony clie. I try my code (your code exactly) but the bytes are not stable, and I am a negative result. The IR diode is connecting at the ra.0 pin with a 220 ohm resistor. The other pin of the diode is at the ground. My code is : MesHor(0)=64 MesHor(1)=128 MesVert(0)=22 MesVert(1)=222 ' empèche mesure en int pendant émission et affichage StopIR = 1 'gosub @trame,DebTr gosub @trame,MesHor(0) gosub @trame,MesHor(1) gosub @trame,MesVert(0) gosub @trame,MesVert(1) StopIR = 0 GOSUB Delay, 8, 1 ' pour laisser le temps de faire la mesure goto Main ' ------------------------------------------------------------------------- ' Page 1 Code ' ------------------------------------------------------------------------- Page_1: ADDRESS $200 Trame: temp0 = __PARAM1 GOSUB @Ir_Modulate, start_bit GOSUB Delay, 2, 1 GOSUB Send_IR_Msg,temp0 GOSUB @Ir_Modulate, stop_bit RETURN 'modérateur : Send_IR_Msg: temp1 = __PARAM1 ' copy of message FOR idx = 0 TO 7 ' send 8 bits temp2 = 2 + temp1.0 GOSUB Ir_Modulate, temp2 ' module temp1 = temp1 >> 1 ' shift bits right GOSUB Delay, 2, 1 ' inter-bit delay NEXT idx RETURN IR_Modulate: temp3 = __PARAM1 FREQOUT IrPin, temp3, IrFreq RETURN Delay: temp2 = __PARAM1 temp3 = __PARAM2 PAUSE temp2 * temp3 RETURN Thanks for you help. Jean ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=96647 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)