Thanks to ThatGuyJohn that have post a link to this page
So now I can control a LED and everything works fine
BUT I have one problem
In a another project I got I was create a Remote controll with IR
So I can controll a TV with buttons.
Now I like to combine this two project so I can turn on and off with my computer.
But nothing happend when I Push the button on my VB.NET program.
I think the problem is that both use serial?
My code is this
#include <IRremote.h>
IRsend irsend;
unsigned int PowerOn[68] = {9000,4400,600,1600,650,1600,600,1650,600,500,600,500,650,450,650,450,650,1600,650,450,650,1600,600,1650,600,1600,650,500,600,500,600,1650,600,500,600,1600,650,1600,650,1600,600,500,650,1600,600,500,600,500,650,450,650,500,600,500,600,500,600,1650,600,500,600,1650,600,1600,650,1600,650};
unsigned int Source[68] = {9000,4400,600,1650,600,1600,650,1600,650,450,650,500,600,500,600,500,600,1650,600,500,600,1650,600,1600,650,1600,600,500,650,450,650,1600,600,500,650,450,650,500,600,500,600,500,600,1650,600,500,600,500,650,450,650,1600,600,1650,600,1600,650,1600,650,450,600,1650,650,1600,600,1600,650};
void setup()
{
Serial.begin(9600);
}
void loop() {
while (Serial.available() == 0);
int val = Serial.read() - '0';
if (val == 1) {
irsend.sendRaw(PowerOn,68,38);
}
else if (val == 0)
{
irsend.sendRaw(Source,68,38);
delay(500);
}
else // if not one of above command, do nothing
{
}
}
Do anyone have any idea what to do?