I'm new to the infrared World, and I'm using an Arduino with "Ken Shirriff" Library "IRremote".
I have successfully created a small code to send and receive infrared signals between 2 Arduinos. My problem is I need to send custom codes using irsend.sendRaw(RawArray, ArrayLength, 38).
Lets say I want to send this HEX: A12345 That can converted to the Binary: 101000010010001101000101
I know that from the Binary I can create the Raw codes, but that's where I'm stuck. I have already chosen my "0", "1", and "space" values, respectively "500", "1000" and "500", so: Binary 1 = Raw code {500, 1000} Binary 0 = Raw code {500, 500}
With that I can create the array: RawArray[48] = {500, 1000, 500, 500, 500, 1000, 500, 500, 500, 500, 500, 500, 500, 500, 500, 1000, 500, 500, 500, 500, 500, 1000, 500, 500, 500, 500, 500, 500, 500, 1000, 500, 1000, 500, 500, 500, 1000, 500, 500, 500, 500, 500, 500, 500, 1000, 500, 500, 500, 1000,}
Now, I'm missing the starter values from my Array, that are supposed to give the "settings" of my transmission, I belive they are called HDD_MARK and HDR_SPACE. I find so many different explanations, that go on completely different approaches that I'm completely lost at this point.
Can someone explain me how to calculate and include those values?
|