Things used in this project

Hardware components:
A000057 featured
Arduino Leonardo
×1
IR receiver (generic)
×1
TV Remote
×1

Schematics

Schematic
Schematic
Schematic
Schematic

Code

PPT_Pointer_Code_2.inoArduino
#include <IRremote.h>
#include "Keyboard.h"

int RECV_PIN = 2;

IRrecv irrecv(RECV_PIN);

decode_results results;
int key_pressed;
int last_key_pressed;

void setup()
{

  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  Keyboard.begin();

}

void loop() {

//Stuff to read the TV remote
  if (irrecv.decode(&results)) {
    key_pressed = results.value;
    Serial.println(key_pressed);
    irrecv.resume(); // Receive the next value
  }

  if (key_pressed == last_key_pressed) key_pressed = 0; //I only want to check one time, what key was pressed

  if (key_pressed == 18105) { //Change this number according to the keys that you want to use in your remote
    Keyboard.press(KEY_RIGHT_ARROW);
    Keyboard.releaseAll();

  }

  if (key_pressed == -22951) {//Change this number according to the keys that you want to use in your remote
    Keyboard.press(KEY_LEFT_ARROW );
    Keyboard.releaseAll();

  }

  last_key_pressed = key_pressed;

}
PPT_Pointer_Code_1.inoArduino
#include <IRremote.h>

int RECV_PIN = 2;

IRrecv irrecv(RECV_PIN);

decode_results results;
int key_pressed;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    
    key_pressed = results.value;
    Serial.println(key_pressed);
    
    irrecv.resume(); // Receive the next value
  }
  delay(100);
}

Credits

Me
Hugo Gomes

http://www.hugogomes.net

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Using 9 Axes Motion Shield with Arduino
Easy
  • 39
  • 3

Protip

The Arduino 9 Axes Motion Shield allows your Arduino to measure movement: orientation, acceleration and magnetic field.

Guess the Number With Arduino KeyPad
Easy
  • 98
  • 3

Full instructions

A simple and funnies project with an Arduino UNO and the famous keypad shield. Arduino selects a random number, you guess the number.

LED Roulette Game
Easy
  • 36
  • 2

Full instructions

A fun pocket-sized travel game for any age. Try your luck and make the light stop on the green LED.

Bluetooth Control Multitap
Easy
  • 6
  • 1

This is a multi-tap that can be linked to a smartphone and Bluetooth to control the supply of electricity to a smartphone

Potentiometer with RGB LED
Easy
  • 46
  • 2

This uses potentiometers to control a RGB LED.

Control a 7 Segment Display with a keypad!
Easy
  • 145
  • 2

Full instructions

In this project I'll show you a simple way to control a 7 Segment Display with a keypad!

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog