Decoding IR Codes Using C#?

I'm currently working on a voice controlled TV remote. I'm using a STM32F4Discovery board, an IR Receiver VS1838B And an IR Transmitter.

The first time I tried to approach this project was with another IR receiver which was a horrible mistake as it was a simple IR receiver that detected all sorts of IR.

When I first got the better receiver (the VS1838B) I tried to do the following:

 public class Program 


static Input Port IR_REC=newInputPort(Pins.GPIO_PIN_A_6, false, ResistorModes.Disabled); static OutputPort IR_TX = new OutputPort(Pins.GPIO_PIN_D_11, false);

public static void Main() { while (true) { //Transmission IR_TX.Write(IR_REC.Read()); } } 


I could then press buttons on the TV remote and see the IR transmitter blinking accordingly,but unfortunately the IR transmitter was always "HIGH".

I then tried changing the Transmission line to this:

while (true) { IR_TX.Write(!IR_REC.Read()); } and managed to get the IR transmitter off untill I was pressing buttons on the TV remote pointed to the IR receiver. So the logic behind this was read from the receiver and then write to the transmitter what you've got from the receiver,makes sense right? well still no luck!

Cant seem to understand why :S

Any help would be appreciated!

by danirockdude2 via /r/csharp

Leave a Reply