Question

In: Electrical Engineering

Design and program an Arduino-based circuit that contains the following items - 1 Arduino Uno microcontroller....

Design and program an Arduino-based circuit that contains the following items
- 1 Arduino Uno microcontroller.
- 1 IR remote control,
- 1 IR sensor
- 1 LCD 16x2 Display
- Any other components you find necessary.
The circuit will do the following:
- The circuit represents a 2-digit calculator.
- At start of operation, the LCD display should display “0” in line 2 of the LCD display.
- Pressing the On/Off button on the IR remote represents the “Clear” button of the calculator, the VOL+ represents the “+” button, the VOL- represents the “-” button, the |<< represents the “X” button, the >>| represents the “/” button, the EQ represents the “=” button, and the digits represent the digits on the calculator.
- The system expects always the following sequence of keys:
[1] Clear,
[2] a digit (representing the 10s of first number),
[3] a digit (representing the ones of first number),
[4] an operation (+, -, X, /),
[5] a digit (representing the 10s of the second number),
[6] a digit (representing the ones of the second number),
[7] Equal
- After a correct sequence of presses is input (total of 7 presses), the display should display something like the following on the two lines of the LCD:
“17+29= ”
“46 ”
- If a wrong sequence of buttons is pressed, for example: “Clear, 9, X, +, …. “, the system should display “ERROR” in the upper line of the LCD.
- You may need to use the “#include <string.h>”

Solutions

Expert Solution

// include the library code:
#include <LiquidCrystal.h> //for LCD
#include <IRremote.h> //For IR Remote

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd( 7, 6, 5, 4, 3,2);
//IR interfacing pins
int RECV_PIN =8;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup() {
Serial.begin(9600);
irrecv.enableIRIn();
  
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
//lcd.print("hello, world!");
}

void loop() {
char temp;

lcd.clear(); //step 1
//10th place---------------step 2

if (irrecv.decode(&results)){
value = results.value;
temp = GetLetters(value);
lcd.setCursor(1, 0);
lcd.print(temp);
//unit place--------------step 3
if (irrecv.decode(&results)){
value = results.value;
temp = GetLetters(value);
lcd.setCursor(1, 0);
lcd.print(temp);
//Sign--------------step 4
value = results.value;
temp = GetLetters(value);
lcd.setCursor(1, 0);
lcd.print(temp);
//2nd no 10th place--------------step 5
value = results.value;
temp = GetLetters(value);
lcd.setCursor(1, 0);
lcd.print(temp);
//2nd no unit place------------------step 6
value = results.value;
temp = GetLetters(value);
lcd.setCursor(1, 0);
lcd.print(temp);
//---------------------equal to---------
lcd.setCursor(0, 1);
value = results.value;
temp = GetLetters(value);
ans =(temp1,temp2)temp3(temp4,temp5);
if(value = "=")
lcd.print(ans);


  

}

char GetLetters(value)
{Serial.println(value);   
switch(value){
case 12495: //Keypad button "1"
//set color red
return "1";
}
switch(value){
case -7177: //Keypad button "2"
//set color skyblue
return "2";
}
switch(value){
case 539: //Keypad button "3"
//set color pink
return "3";
}
switch(value){
case 25979: //Keypad button "4"
//set color light green
return "4";
}

//simillarly You Have to write a all Values Correasponding to the key   
irrecv.resume();
  
  
}

if you have any queries you can ask in the comment...


Related Solutions

Pharaphrase and rewrite the following paragraph: Arduino Arduino Uno is a microcontroller board b... pharaphrase and...
Pharaphrase and rewrite the following paragraph: Arduino Arduino Uno is a microcontroller board b... pharaphrase and rewrite the following paragraph: Arduino Arduino Uno is a microcontroller board based on the ATmega328P (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect it to...
Produce program code to facilitate LED and switch interface with a microcontroller-based development board (Arduino). Explain...
Produce program code to facilitate LED and switch interface with a microcontroller-based development board (Arduino). Explain the programming process and interface circuits required
With an Arduino Uno: Using 2 external buttons b0 and b1 to represent ‘0’ and ‘1’,...
With an Arduino Uno: Using 2 external buttons b0 and b1 to represent ‘0’ and ‘1’, design a sequence detector to detect a pattern “1101”. An LED lights up once, when the sequence “1101” occurs.
An MSP430 microcontroller system is to be designed with the following requirements: The circuit operates from...
An MSP430 microcontroller system is to be designed with the following requirements: The circuit operates from a 5 V supply with a decoupling capacitor. 2 LEDs (IF=15mA, VF = 1.9V) are connected to pins P1.2, P1.3. P1.4 on the microcontroller. These LEDs should have appropriate current limiting resistors and be connected in a sinking arrangement. 1 Push button should be connected to P2.1 using an external pull-up resistor 1 Push button should be connected to P2.2 using the internal pull-up...
Procedure a. Design and build a circuit based on the subtractor adder to implement the following...
Procedure a. Design and build a circuit based on the subtractor adder to implement the following equation: Y=2X +1.5 b. Check the operation of the circuit, entering 10 different values ​​of X and measuring the result obtained in Y. Use a source of +-15 volts to polarize the circuit c. Graph the results and obtain the equation of that graph.
1) design a circuit that output is generated based on the control signals Inputs are A1,...
1) design a circuit that output is generated based on the control signals Inputs are A1, A0 and B1, B0 C1 C0 Output 0      0 add 0      1       subtract 1 0 AND 1 1       EXOR 2) Design a 5 by 32 decoder using 3 by 8 or smaller decoders
arduino programing Question 1: write an APL program that will print the following output on the...
arduino programing Question 1: write an APL program that will print the following output on the serial monitor 10 times only.   Output:  1 2 3 4 5 Question 2: write an APL program that will turn the traffic lights on and off by taking input from the Serial port working at 11500 bits processing rate. Use r or R for RED LIGHTS, y or Y for YELLOW LIGHTS and g or G for GREEN LIGHTS.    Question 3: write an APL...
Design a Digital Voting Machine using microcontroller based device which can be performed in election electronic...
Design a Digital Voting Machine using microcontroller based device which can be performed in election electronic voting system. (You can allow five candidates and 50 users. The overall result of the election should be displayed after all.) Create an algorithm to design a solution Write a programme to implement the given specification selecting an appropriate microcontroller. (Use Assembly or C languages) Please attach schematic diagrams (Circuit diagram).
Write an assembly language program for 8051 microcontroller to find the sum of the following series,...
Write an assembly language program for 8051 microcontroller to find the sum of the following series, 1, -2, +3, -4, +5, -6,..., up to 100 terms. Store lower byte in R0 and higher byte in R1.
Write the following in C language for Arduino: Write a program that turns on the LED...
Write the following in C language for Arduino: Write a program that turns on the LED at 25%, 50%, 75%, 100%, and then 0% brightness with a one second delay in between each change. Remember you are going to need to use a PWM pin and use the "analogWrite" command. The maximum value for our Arduino R3 boards is 255 and you need five steps (25%, 50%, 75%, 100%, and 0%) so you will need to determine the values for...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT