Devices & Components
Arduino Micro
470 ohm resistors 10x
IR Receiver Tsop2238 - 38 KHZ
10 Red LED 5mm
10 100 ohm 1/4w resistor
Project description
Code
Code snippet #3
arduino
1- const int nextSlide = 0x0x800F046E // this line need to be inserted at the begin of the sketch //this case statement needs to be added inside the switch construct case nextSlide: Keyboard.press(KEY_RIGHT_ARROW); commandExecuted = 1; break
Code snippet #3
arduino
1- 2 const int nextSlide = 0x0x800F046E // this line need to be inserted at the begin of the sketch 3 4 //this case statement needs to be added inside the switch construct 5 case nextSlide: 6 Keyboard.press(KEY_RIGHT_ARROW); 7 commandExecuted = 1; 8 break
Code snippet #1
arduino
1/* VLC IR REMOTE CONTROLLER 2 * 3 * Control your computer while using VLC 4 * with any IR remote controller you want. 5 * 6 * Created by 7 * Angelo Scialabba 8 * Arturo Guadalupi 9 * 10 * Based on IRremote library by Ken Shirriff 11 */ 12 13#include <irremote.h> 14int RECV_PIN = 11; //IR receiver connected on pin 11 15int LED_PIN = 2; 16int commandExecuted = 0; 17//Change these values to match data sent by your remote control 18 19/*-----COMMANDS------*/ 20const long play = 0x800F046E; 21const long volumeUp= 0x800F0410; 22const long volumeDown= 0x800F8411; 23const long forward= 0x800F8414; 24const long backward= 0x800F0415; 25const long mute= 0x800F040E; 26/*-----END COMMANDS------*/ 27 28 29IRrecv irrecv(RECV_PIN); //initialize IR library on RECV_PIN 30decode_results results; //received data will be stored here 31 32void setup() 33{ 34 pinMode(LED_PIN,OUTPUT); 35 digitalWrite(LED_PIN,LOW); 36 irrecv.enableIRIn(); // Start the receiver 37 Keyboard.begin(); //Start arduino as keyboard 38} 39 40void loop() { 41 if (irrecv.decode(&results)) { 42 switch(results.value){ //fetch received data 43 case play: 44 Keyboard.press(' '); 45 commandExecuted = 1; 46 break; 47 case volumeUp: 48 Keyboard.press(KEY_LEFT_CTRL); 49 Keyboard.press(KEY_UP_ARROW); 50 commandExecuted = 1; 51 break; 52 case volumeDown: 53 Keyboard.press(KEY_LEFT_CTRL); 54 Keyboard.press(KEY_DOWN_ARROW); 55 commandExecuted = 1; 56 break; 57 case forward: 58 Keyboard.press(KEY_LEFT_CTRL); 59 Keyboard.press(KEY_RIGHT_ARROW); 60 commandExecuted = 1; 61 break; 62 case backward: 63 Keyboard.press(KEY_LEFT_CTRL); 64 Keyboard.press(KEY_LEFT_ARROW); 65 commandExecuted = 1; 66 break; 67 case mute: 68 Keyboard.press('m'); 69 commandExecuted = 1; 70 break; 71 } 72 if ( commandExecuted == 1) { //turn on the LED a command was executed 73 digitalWrite(LED_PIN,HIGH); 74 commandExecuted = 0; // reset the flag value 75 } 76 delay(100); 77 digitalWrite(LED_PIN,LOW); 78 Keyboard.releaseAll(); 79 80 irrecv.resume(); // Receive the next value 81 } 82}
Comments
Only logged in users can leave comments