Main Site Documentation

How can I use IR receiver on my pandaII


#1

hello everyone

I bought a pair of IR receiver and remote control but I dont know how I can use it because I dont know what remote control send. I tried to read by LCD but I couldnt because I read different number on LCD even though I didnt push any button. if there is anyone who know about this, I will be pleasant


#2

We need more info on your receiver.


#3

Edit: my code was not meant to be used with your IR receiver :frowning: I thought you were speaking of FEZ IR receiver.

Sorry.


#4

firstly thanks quick reply :clap:

I added photo of device and here is my code:

Cpu.Pin myPin = (Cpu.Pin)FEZ_Pin.Digital.Di0;
OneWire ow = new OneWire(myPin);

         byte message;
         while (true)
         {
             LCD.Clear();

             message = ow.ReadByte();
                LCD.Printf( message.ToString());
                Thread.Sleep(1000);
                 
             
          }

but even though I didnt push any button some number show up on the screen


#5

Do you have datasheet or technical specification on the receiver?


#6

but I have remote control so I cant change code it send. I need to know what it send. and I cant control because it is not regular


#7

sorry I dont have. I asked and looked for on the net but I couldnt find anything


#8

Mmm, why do you think it’s a onewire device??


#9

because I can get data only serial… how can I do this else


#10

serial is not onewire. Your code is trying to use onewire. Have you tried using serial?


#11

no because I dont know how to use serial in c# could you help me?


#12

I think I saw some arduno code on internet for that module. Check that.


#13

but I dont know to use serial communication on c# I thought it is same onewire


#14

nope, different.

look at the tutorials, there’s serial comms info there for sure…


#15

in there all of them is about serialport. mine is not about this


#16

Do you have an oscilloscope or logic analyser?

Check what that line looks like when you press different buttons.


#17

Perhaps if you can put on the forum any info from the IR receiver device - like manufacturer and model number (any info on the board itself).

Using Onewire will not work if it’s a Serial Device. Using Serial will not work if it’s I2C. etc…


#18

so which one must I use if I have IR receiver?


#19

It depends on the board you have — each one is different.

So either use the information on the board and chip on the IR Receiver to lookup on the internet

… OR …

as Architect mentioned try to use an oscilloscope or logic analyser.


#20

ok I solved my problem using serial communication thanks for everyone. if any one who has same problem code is here:

LCD.Initialize();
LCD.CursorHome();
SerialPort UART = new SerialPort(“COM1”, 300);
int read_count = 0;
byte[] rx_byte = new byte[1];

        UART.Open();
        while (true)
        {
            LCD.Clear();
            // read one byte
            read_count = UART.Read(rx_byte, 0, 1);
            if (read_count > 0)// do we have data?
            {
                // create a string
                string counter_string = rx_byte[0].ToString();
                LCD.Printf("mesaj="+counter_string+" ");

                Thread.Sleep(1000);
            }