Avatar for KFK-mpg

KFK-mpg

Member since Jul 2015 • Last active Dec 2017
  • 1 conversations
  • 5 comments

Most recent activity

    • 12 comments
    • 4,050 views
  • in Projects
    Avatar for KFK-mpg

    Hey,
    i tested the other controller, on receiving data, and it is a little bit frustrating. Above, the description don`t works on this controller.

    For this pulse:

      var pulse = [0.6, gap, 1.0, gap, 0.6, gap, 1.0, gap, 1.0, gap];
    

    i get this console.log:

    1011
    

    I don`t know, where the problem is and which controller will be right....puh

    I used a normal IR LED and a vs1838b

    Sry, i don`t have an oscilloscope :(
    best regards

  • in Projects
    Avatar for KFK-mpg

    Hey,
    thanks for your really good support. The LED is connected in right way. That was the first, what i checked. But it was a really nice thinking :)
    Yesterday, i tested a little bit and solve the problem. The solution is (for me) confusing and i don`t know the technical details.

    Sending a zero:

    [1.0, gap]
    

    Sending a 1:

    [gap, 1.0]
    

    and as last bit for end of transmitting:

    [gap]
    

    If you send no 'gap' as last, it won`t be shown the string in the console.

    Complete code for sending '101001':

    digitalWrite(B7, 0); // Set B7 to GND
    digitalWrite(A8, 1); // Set A8 to 3.3V
    // Because we're not using the module, we have to manually pull up the data pin
    pinMode(B6,"input_pullup");
    
    setInterval(function(){
      
      var gap = 0.5;
    //  var pulse = [0.6, gap, 0.6, gap, gap, 2.0, gap, gap, 0.6];
        var pulse = [gap, 1.0, 1.0, gap, gap, 1.0, 1.0, gap, 1.0, gap, gap, 1.0, gap];
    
      digitalWrite(LED1,1);
      
      analogWrite(A5, 0.9,{freq:38000});
      
      digitalPulse(A6, 1, pulse);
      
      digitalPulse(A6, 1, 0);
      
      digitalWrite(LED1,0);
    },1000);
    

    best regards

  • in Projects
    Avatar for KFK-mpg

    Hi,

    thanks for your answer. It was very helpful. Now i tested with the follow code:

    Transmitter:

    digitalWrite(B7, 0);
    digitalWrite(A8, 1); 
    pinMode(B6,"input_pullup");
    
    setInterval(function(){
      
      var gap = 0.5;
      var pulse = [1.0, gap, 1.0, gap, 0.6, gap, 1.0];
      
      digitalWrite(LED1,1);
      
      analogWrite(A5, 0.9,{freq:38000});
      
      digitalPulse(A6, 1, pulse);
      
      digitalPulse(A6, 1, 0);
      
      digitalWrite(LED1,0);
    },1000);
    
    

    and Receiver code:

    digitalWrite(B7, 0); 
    digitalWrite(A8, 1); 
    
    require("IRReceiver").connect(B6, function(code) {
    
      console.log(code);
      
      if(code === '0010') digitalWrite(LED2, 1);
      
    });
    

    I get every time a '000' in the console and no LED will be switched on. Sometimes an '0001'. Is there way to transmit correctly or did i something wrong?

    Sry.

    best regards
    Daniel

  • in Projects
    Avatar for KFK-mpg

    Hey,
    thanks for your reply. For correct understanding:

    If i use Gordon`s IRReciever (what i want), and sending a logical 1, i have to use at first:

    analogWrite(A5,0.9,{freq:38000});
    

    and than:

    digitalPulse(A6, 1, 1);
    

    and for a logical 0:

    digitalPulse(A6, 1, 0.8); //or less
    

    ?

    In my mind so i have to send '110':

    digitalPulse(A6, 1, [1,1, 0.8]);
    

    sry for my nooby question/post, but i only want to understand.

    best regards
    daniel

  • in Projects
    Avatar for KFK-mpg

    Hi@all,

    i recieved 2 Picos and they are great. For Project, both have to communicate together over infrared. I have tested this tutorial . Receiving tv remote signals is no problem. But i have trouble with sending data. I want to send my own data like '10001111'. How can i do this? Have anyone an idea? I hope you can help me.

    best regards
    daniel

Actions