Question
Here is the used code but it is incomplete, please fix it and put the missing: #include IRremote.h /*-----( Declare Constants )-----*/ int receiver =
Here is the used code but it is incomplete, please fix it and put the missing:
#include "IRremote.h"
/*-----( Declare Constants )-----*/ int receiver = 13; // pin 1 of IR receiver to Arduino digital pin 10
/*-----( Declare objects )-----*/
const int latchPin = 8; const int clockPin = 12; const int dataPin = 11;
IRrecv irrecv(receiver); // create instance of 'irrecv' decode_results results; // create instance of 'decode_results' /*-----( Declare Variables )-----*/
unsigned char lookup_7seg[] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F, 0x80}; void setup() /*----( SETUP: RUNS ONCE )----*/ {
pinMode(latchPin, OUTPUT); pinMode(clockPin, OUTPUT); pinMode(dataPin, OUTPUT); Serial.begin(9600); Serial.println("IR Receiver Raw Data + Button Decode Test"); irrecv.enableIRIn(); // Start the receiver
}/*--(end setup )---*/
void loop() /*----( LOOP: RUNS CONSTANTLY )----*/ { if (irrecv.decode(&results)) // have we received an IR signal?
{ Serial.println(results.value, HEX); // UN Comment to see raw values translateIR(); irrecv.resume(); // receive the next value } }/* --(end main loop )-- */ // displays the dice number on the 7-seg display void DiceNumber(unsigned char num) { digitalWrite(latchPin, LOW); shiftOut(dataPin, clockPin, MSBFIRST, lookup_7seg[num]); digitalWrite(latchPin, HIGH); delay(1000); digitalWrite(latchPin, LOW); shiftOut(dataPin, clockPin, MSBFIRST, lookup_7seg[10]); digitalWrite(latchPin, HIGH); delay(50);
}
/*-----( Declare User-written Functions )-----*/ void translateIR() // takes action based on IR code received
{
switch(results.value)
{ case 0xFF6897: Serial.println(" 0 "); DiceNumber(0); break;
case 0xFF30CF: Serial.println(" 1 "); DiceNumber(1); break;
case 0xFF18E7: Serial.println(" 2 "); DiceNumber(2); break;
case 0xFF7A85: Serial.println(" 3 "); DiceNumber(3); break;
case 0xFF10EF: Serial.println(" 4 "); DiceNumber(4); break;
case 0xFF38C7: Serial.println(" 5 "); DiceNumber(5); break;
case 0xFF5AA5: Serial.println(" 6 "); DiceNumber(6); break;
case 0xFF42BD: Serial.println(" 7 "); DiceNumber(7); break;
case 0xFF4AB5: Serial.println(" 8 "); DiceNumber(8); break;
case 0xFF52AD: Serial.println(" 9 "); DiceNumber(9); break;
default: Serial.println(" other button ");
}
} //END translateIR
/* ( THE END ) */
1. Project Description: Utilizing the remote control to display the following digits on the seven segment display Remote Button Press Seven Segment Display Out 4 5 Fast Forward Fast Reverse " Plus "MinuS If your remote doesn't have the specified buttons shown above you can use other buttons on the remote for the letter characters. When a button is press the number/character shall be displayed for 1 second and then clear the display and display the decimal point Provide the following a. Code listing b. Electronic Parts used: Arduino IR sensor-Connect IR sensor to pin 11 of arduino Remote Display, resistors, shift register IC Schematic of how display is connected (may be drawn by hand) 1. Project Description: Utilizing the remote control to display the following digits on the seven segment display Remote Button Press Seven Segment Display Out 4 5 Fast Forward Fast Reverse " Plus "MinuS If your remote doesn't have the specified buttons shown above you can use other buttons on the remote for the letter characters. When a button is press the number/character shall be displayed for 1 second and then clear the display and display the decimal point Provide the following a. Code listing b. Electronic Parts used: Arduino IR sensor-Connect IR sensor to pin 11 of arduino Remote Display, resistors, shift register IC Schematic of how display is connected (may be drawn by hand)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started