I analysed a hard to find IR remote from a drum computer, and wrote some code to write down the outcoming data and managed to retreive all keycodes and the device code. Also saw the mirroring of the command byte as 4rd byte of the pulse. No idea it was a NEC protocol yet.
Then I found background info. Trying to send a signal was harder, so I thought lets use a library. I found the Teensy explanation to be the cleanest:
https://www.pjrc.com/teensy/td_libs_IRremote.html
Imo the way to document things. not blow things out of proportion like the current github repo documentation. The Teensy sample does not show how to send a 32bit code though with my structure.
So I can't get this to example to work, I started with a visible blue LED to check if light is produced.
Protocol is NEC 38kHz
This is the device address in the order of light pulses, it is send first:
B00000001,B00110110
you could write it as
word deviceCode=0x0136;
And this is a sample command (it should be send twice, second time inverted)
byte command=B01111000, // down
in hex it would be 0x78
Can someone give me the simplest bit of code that just sends this command in setup for example. Please mention the required IR LED pin for your example if I use a Leonardo or a Attiny85. Please use the variables deviceCode and command in the example. If the format is not usuable, then explain how to reformat. I don't want to include all codes as full 32bit chunk, as that is a waste of memory.