ir protocols - unknown / send raw

I am trying to build a receiver and transmitter for the nerf laser gun and I faced the following issues:

When I try to read the signals using a vs1838b receiver and IRremote library I get that the code - type is unknown (not NEC, JVC, SONY etc’) so I get the code as an array which I don’t understand and can’t seem to understand how to send/ transmit using the “sendRaw” command.

Example for this :

Received unknown code, saving as raw
m2800 s2100 m900 s2100 m900 s2100 m800 s2100 m900 s2100 m1850 s2100 m900 s2050 m900

A6E654CD - (this is the value ? ).

So how can I send this at the Emmiter led ?

Your emitter seems to be sending some sort of home-brew code.

I don't use the IR librairies so I can't help you with that. Maybe if you give the output from the following sketch, someone else will be able to help you.

int pin = 7;
unsigned long duration;

void setup()
{
  Serial.begin(115200);
  pinMode(pin, INPUT);
}

void loop()
{
  duration = pulseIn(pin, LOW);
  if(duration)
  Serial.println(duration);  
}

If not, you're going to have to do some reading.

https://www.analysir.com/blog/2015/05/12/simple-infrared-pwm-on-arduino/

kayel: Your emitter seems to be sending some sort of home-brew code.

I don't use the IR librairies so I can't help you with that. Maybe if you give the output from the following sketch, someone else will be able to help you.

int pin = 7;
unsigned long duration;

void setup() {   Serial.begin(115200);   pinMode(pin, INPUT); }

void loop() {   duration = pulseIn(pin, LOW);   if(duration)   Serial.println(duration);  }




If not, you're going to have to do some reading.

https://www.analysir.com/blog/2015/05/12/simple-infrared-pwm-on-arduino/

Thanks.. I don't successes with this. but I have another question, Is there a relation between the array - RAW to the code - value ?

The raw code looks like it shows the marks and spaces sent by whatever you're sending with, in microseconds.

A6E654CD might be a hash code, but I'm just guessing. If it's a hash code, it's created from the raw code using a complicated algorithm. You need to send marks and spaces, or read the documentation for the library you're using.

The link I gave in my first reply shows how to send marks and spaces.

The little sketch I posted works. Try pointing a TV remote at the receiver and press a button. It should give you something ressembling the raw data, without the spaces. Your spaces seem to be all 2100µs so you just send a space(2100) between each mark(timeµs).

The image shows the raw data sent by a Sony TV remote, without the spaces. They are all around 600µs, so no need to record them. The first seven pulses after the 2400µs start pulse are the data, LSB first. The next five pulses are the address, LSB first. You only need the address if you have more than one receiver.

In Sony code, 600µs represents a zero bit, 1200µs represents a one bit.

As you can see, IR pulses are not very precise.

I was pressing button 6 which in Sony code sends 5.

kayel:
The raw code looks like it shows the marks and spaces sent by whatever you're sending with, in microseconds.

A6E654CD might be a hash code, but I'm just guessing. If it's a hash code, it's created from the raw code using a complicated algorithm. You need to send marks and spaces, or read the documentation for the library you're using.

The link I gave in my first reply shows how to send marks and spaces.

The little sketch I posted works. Try pointing a TV remote at the receiver and press a button. It should give you something ressembling the raw data, without the spaces. Your spaces seem to be all 2100µs so you just send a space(2100) between each mark(timeµs).

The image shows the raw data sent by a Sony TV remote, without the spaces. They are all around 600µs, so no need to record them. The first seven pulses after the 2400µs start pulse are the data, LSB first. The next five pulses are the address, LSB first. You only need the address if you have more than one receiver.

In Sony code, 600µs represents a zero bit, 1200µs represents a one bit.

As you can see, IR pulses are not very precise.

I was pressing button 6 which in Sony code sends 5.

Awesome ! can I convert the RAW code to HEX number ?

If you mean a HEX number in general, the image shows a Sony remote sending 0x05 to the receiver whose address is 0x01.

If you mean a HEX number like A6E654CD, then no doubt you can, your first post says so.

To find out how to do it and what to do with the number once you've got it, you'll have to study the library files.

I don't know.

https://github.com/rmick/LTTO_Library ??