Professional Documents
Culture Documents
Sandibell Vega Final Project
Sandibell Vega Final Project
Sandibell Vega Final Project
The project goals where It can give a calculation to the user and provide the answer. It
creates a project where a chatbot mathematics responds with your math problem.
Where it displays the using a LCD and Keypad with Arduino uno where help to solve
like a calculator. Just learn how to do a calculation this helps learn the basic
programming and the functions of LCD with the Keypad.
● Project Implementation
○ Schematics
LCD x1
Arduino uno x1
Keypad x1
Wires x 24
Potentiometer x1
Resistor x 1
○ Hardware Design
■ Mechanical Drawings
○
○ Software Design
■ Code listing with user’s guide
#include <LiquidCrystal.h>
#include <Keypad.h>
long first = 0;
long second = 0;
double total = 0;
int posit = 0 ;
char customKey;
const byte ROWS = 4;
const byte COLS = 4;
void setup(){
lcd.begin(16,2);
lcd.setCursor(5,0);
lcd.print("Hello, my ");
lcd.setCursor(3,1);
lcd.print("name is UAT");
delay(3000);
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("Basic Calculator");
lcd.setCursor(4,1);
lcd.print("Arduino");
delay(2000);
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("I'm a Chatbot");
lcd.setCursor(4,1);
lcd.print("that loves Math");
delay(1000);
lcd.clear(); //clears the LCD screen and positions the cursor in
the upper-left corner.
}
void loop()
{
customKey = customKeypad.getKey();
switch(customKey)
{
case '0' ... '9': // get first value for calculation
lcd.setCursor(0,0);
first = first * 10 + (customKey - '0');
lcd.print(first);
posit++;
break;
case '+':
first = (total != 0 ? total : first);
lcd.setCursor(posit,0);
lcd.print("+");
posit++;
second = SecondNumber(); // get second number
total = first + second;
lcd.setCursor(1,1);
lcd.print(total);
first = 0, second = 0; // reset the values
posit=0;
break;
case '-':
first = (total != 0 ? total : first);
lcd.setCursor(posit,0);
lcd.print("-");
posit++;
second = SecondNumber();
total = first - second;
lcd.setCursor(1,1);
lcd.print(total);
first = 0, second = 0;
posit=0;
break;
case '*':
first = (total != 0 ? total : first);
lcd.setCursor(posit,0);
lcd.print("*");
posit++;
second = SecondNumber();
total = first * second;
lcd.setCursor(1,1);
lcd.print(total);
first = 0, second = 0;
posit=0;
break;
case '/':
first = (total != 0 ? total : first);
lcd.setCursor(posit,0);
lcd.print("/");
posit++;
second = SecondNumber();
lcd.setCursor(1,1);
lcd.print(total);
first = 0, second = 0;
posit=0;
break;
case 'C':
total = 0;
first = 0;
second = 0;
posit = 0;
lcd.clear();
break;
}
}
long SecondNumber()
{
while( 1 )
{
customKey = customKeypad.getKey();
if(customKey >= '0' && customKey <= '9')
{
second = second * 10 + (customKey - '0');
lcd.setCursor(posit,0);
lcd.print(second);
}
if(customKey == 'C') {
total = 0;
first = 0;
second = 0;
posit = 0;
lcd.clear();
break;
}
if(customKey == '='){
lcd.setCursor(0,1);
lcd.print("=");
posit = total;
lcd.clear();
lcd.setCursor(0,1);
lcd.print("=");
break;
}
}
return second;}
● Development Issues
○ Any problems / difficulties you encountered during development
There are some difficulties I have encountered during development however I solve it by
going with my code. I changed my project instead to an emotional chatbot to calculate
where users can get the answer to the problem. Beside that I had fun learning and to be
exposed toward this project.
The solutions to the problems change the project and go over my code when I run
difficulties. Designing the circuit but I just had to figure it out and had fun dealing with
this project. Also, I hope I had done this first then figure why it doesn’t work the chatbot
wheel and other things. But instead I hope in the future to keep working on the robot
chatbot for my portfolio.
https://youtu.be/TNWVGMJT3m4