Product update in process!!!!
13 years ago
Yesterday, the Malaysian team lost a chance to brag 3 points in the opening match against Singapore. However, we still get 1 point from a 0-0 draw on that match. On the 14th minute...
Manchester United have achieved their victory once again to continue their winning streak. Just 8 minutes after the whistle went off...
After having a disappointment for the last few matches, Arsenal are stunned again by the 14th-ranked Blackburn yesterday. This made Arsenal...
Selangor lost another game with T-Team on a slim 2-1 score after having a draw wtih Kuala Lumpur last Tuesday. On the 14th minute...
Arduino Uno |
IR Receiver |
10K Ohm Resistors |
Phillips Remote Control |
#include <IRremote.h> // use the library
int receiver = 8; // pin 1 of IR receiver to Arduino digital pin 8
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results;
int led1=2;
int led2=3;
int led3=4;
void setup()
{
Serial.begin(9600); // for serial monitor output
irrecv.enableIRIn(); // Start the receiver
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
}
void loop()
{
if (irrecv.decode(&results)) // have we received an IR signal?
{
Serial.println(results.value, HEX); // display it on serial monitor in hexadecimal
irrecv.resume(); // receive the next value
} // Your loop can do other things while waiting for an IR command
//below is triggering mode
//0x???? ????is the HEX code detected, must add 0x to trigger something
switch(results.value){
case 0x458: //1st push (UP Button Phillips)
digitalWrite(led1,HIGH);
break;
case 0x10458: //2nd push
digitalWrite(led1,HIGH);
break;
case 0x45A: //1st push (LEFT Button Phillips)
digitalWrite(led2,HIGH);
break;
case 0x1045A: //2nd push
digitalWrite(led2,HIGH);
break;
case 0x45B: //1st push (RIGHT Button Phillips)
digitalWrite(led3,HIGH);
break;
case 0x1045B: //2nd push
digitalWrite(led3,HIGH);
break;
case 0x45C: //1st push (OK Button Phillips)
digitalWrite(led1,LOW);
digitalWrite(led2,LOW);
digitalWrite(led3,LOW);
break;
case 0x1045C: //2nd push
digitalWrite(led1,LOW);
digitalWrite(led2,LOW);
digitalWrite(led3,LOW);
break;
case 0x459: //1st push (DOWN Button Phillips)
digitalWrite(led1,HIGH);
digitalWrite(led2,HIGH);
digitalWrite(led3,HIGH);
break;
case 0x10459: //2nd push
digitalWrite(led1,HIGH);
digitalWrite(led2,HIGH);
digitalWrite(led3,HIGH);
break;
}
}
Arsenal 2 - Manchester United 8 |