Hugo Gomes
Published © GPL3+

Arduino PowerPoint Pointer

Grab an Arduino and turn it into a Power Point pointer using an IR sensor and your TV remote.

BeginnerFull instructions provided1 hour26,773
Arduino PowerPoint Pointer

Things used in this project

Hardware components

Arduino Leonardo
Arduino Leonardo
×1
IR receiver (generic)
×1
TV Remote
×1

Story

Read more

Schematics

Schematic

Schematic

Code

PPT_Pointer_Code_2.ino

Arduino
#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.ino

Arduino
#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

Hugo Gomes

Hugo Gomes

10 projects • 114 followers
http://www.hugogomes.net Youtube Channel - https://goo.gl/fnQLJo

Comments