IR Codes

From Leo's Notes
Revision as of 03:53, 23 June 2020 by Leo (talk | contribs) (Created page with "== LED Strip Driver IR == alt=RGB LED Strip Remote|left|thumb|221x221px|RGB LED Strip Remote I have a LED strip driver which I wanted to try...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This page was last edited on 23 June 2020, at 03:53.

LED Strip Driver IR

RGB LED Strip Remote
RGB LED Strip Remote

I have a LED strip driver which I wanted to try driving with an Arduino. Using a LCR TC1, the remote control's first button can be decoded as UserCode: 00EF DataCode: 00FF. The last button is decoded as UserCode: 00EF DataCode: 17E8.

After some searching, the codes are of the NEC type. Using the Arduino-IRremote library and some trial an error it looks like the code data is sent as a 4 byte word. The first 2 bytes are for the button number and the last 2 bytes are the inverse of the number.

The Arduino code to sent a button number is given below.

void send(int button) {
	int value = 0;
	
	int check = 0xff - button;
	
	// button is on 1st byte
	for (int x = 0 ; x < 8; x++) {
		// button byte reversed
		value |= (((button & (0x01 << x)) >> x) << (7 - x)) << 8;
		
		// check byte reversed
		value |= ((check & (0x01 << x)) >> x) << (7 - x);
	}
	
	Serial.print("Sending ");
	Serial.print(i);
	Serial.println();
	
	irsend.sendNEC(0x00F70000 + value, 32);
	delay(50);
}

Unfortunately, sending codes outside of the 24 has no effect on the driver. The reason I tested this was because I wanted to control the RGB values which other remotes for other drivers have.