Non FTC Robot Research Project- Page 3

Robotics Application Final Project (In-Person or Remote)


Documentation of the project should follow a Design Process


Design Process Review and Application Guide

Developing

Task 1: Hook Up an Infrared Remote

Task 2: Hook up a Relay Circuit


Proficent 2 / Exemplary Project Design and build a basic robot

Build a Basic Robot

/* This code uses the updated IR remote Library

to read an IR sensor on pin 11 and write a simple on/off

signal to an led on pin 9



*/


#include <IRremote.h>

int red = 9;

int RECEIVER_PIN = 11;

int IRValue;


void setup() {

  // put your setup code here, to run once:

  Serial.begin(9600);

  pinMode(red, OUTPUT);

  pinMode(RECEIVER_PIN, INPUT);

  IrReceiver.begin(RECEIVER_PIN);

}


void loop() {

  // put your main code here, to run repeatedly:

  if(IrReceiver.decode()){    

    Serial.println(IrReceiver.decodedIRData.command);

    IrReceiver.resume();

  IRValue = IrReceiver.decodedIRData.command;

    if (IRValue == 12){

      digitalWrite(red, HIGH);

    }

    else

      digitalWrite(red, LOW);

  }

}