Project showcase

# Quizmo

• 1,302 views
• 11 respects

## Components and supplies

 Arduino UNO & Genuino UNO
×1
 Adafruit Standard LCD - 16x2 White on Blue
×1
×1

## Apps and online services

 Arduino IDE

This project is related to developing a handy gadget to help kids practice basic arithmetic operations. I decided to make it as my kids were very lazy to look into the books and come back very soon saying that they have done it (specially multiplication tables). This gadget randomly asks different questions and evaluate kids performance.

For this you need a 4x3 keypad to interact with the gadget and an LCD to show you results. for connectivity of LCD with arduino, you can follow instructions on below path:

http://www.instructables.com/id/Connecting-an-LCD-to-the-Arduino/

Once you have setup brightness using the rehestat, you can note down the values and replace it with fixed resistors or keep it there if you want the user to adjust brightness as per his/her comfort.

In order to connect keypad with arduino, use guide on this link:

Power up Arduino and it will ask you what kind of quiz you want to take. Selec appropriate option and it will start. Once you have input your answer, you need to press * in order to submit and let the gadeget check your answer. In order to finish the quiz or take next one, press # and main menu will appear again. You can increase the difficulty level from the code by changing the maximum range of random number generator. This gadget currently produces random questions by using numbers from 1 to 12.

## Code

##### Arduino CodeC/C++
Upload this code directly to UNO and make sure you use the wiring similar to mentioned in code
```#include <Keypad.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

long rand1,rand2,ans,ans1,opr,score,total;
char selec,selec1;
boolean quiz=false;
String stringTwo;

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte rowPins[ROWS] = {10, 9, 8, 7}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {6,1,0}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
lcd.begin(16, 2);
}

void loop(){
while (selec==NO_KEY){
}
lcd.print(selec);
delay(500);
if (selec!=NO_KEY){
switch(selec){
case '1':
quiz=true;
opr=1;
quiz_sum();
break;
case '2':
quiz=true;
opr=2;
quiz_subt();
break;
case '3':
quiz=true;
opr=3;
quiz_mult();
break;
}
}
}

lcd.clear();
lcd.setCursor(0, 0);
lcd.print("1)+ 2)- 3)x");
lcd.setCursor(0, 1);
lcd.print("Choose: ");
}
void quiz_sum(){
lcd.clear();
lcd.setCursor(0, 0);
rand1=random(1,99);
rand2=random(1,99);
lcd.print("Find ");
lcd.print(rand1);
lcd.print("+");
lcd.print(rand2);
lcd.print("?");
ans1=rand1+rand2;
while (selec1==NO_KEY){
}
while (quiz){
while (selec1==NO_KEY){
}
switch(selec1){
case NO_KEY:
break;
default:
lcd.print(selec1);
stringTwo.concat(selec1);
ans=stringTwo.toInt();
//lcd.print(stringTwo);
selec1=NO_KEY;
break;
}
}
}

void quiz_subt(){
lcd.clear();
lcd.setCursor(0, 0);
rand1=random(1,99);
rand2=random(1,99);
lcd.print("Find ");
if(rand1>=rand2){
lcd.print(rand1);
lcd.print("-");
lcd.print(rand2);
ans1=rand1-rand2;
}
else if(rand1<rand2){
lcd.print(rand2);
lcd.print("-");
lcd.print(rand1);
ans1=rand2-rand1;
}
lcd.print("?");
while (selec1==NO_KEY){
}
while (quiz){
while (selec1==NO_KEY){
}
switch(selec1){
case NO_KEY:
break;
default:
lcd.print(selec1);
stringTwo.concat(selec1);
ans=stringTwo.toInt();
//lcd.print(stringTwo);
selec1=NO_KEY;
break;
}
}
}

void quiz_mult(){
lcd.clear();
lcd.setCursor(0, 0);
rand1=random(1,12);
rand2=random(1,12);
lcd.print("Find ");
lcd.print(rand1);
lcd.print("x");
lcd.print(rand2);
lcd.print("?");
ans1=rand1*rand2;
while (selec1==NO_KEY){
}
while (quiz){
while (selec1==NO_KEY){
}
switch(selec1){
case NO_KEY:
break;
default:
lcd.print(selec1);
stringTwo.concat(selec1);
ans=stringTwo.toInt();
//lcd.print(stringTwo);
selec1=NO_KEY;
break;
}
}
}

void chk_ans(){
lcd.clear();
if (ans1==ans){
lcd.clear();
lcd.print("Correct");
score=score+1;
}
else {
lcd.clear();
lcd.print("Incorrect");
}
}
case PRESSED:
if (key == '*') {
chk_ans();
total=total+1;
stringTwo="";
delay(400);
if(opr==1){
quiz_sum();
}
else if(opr==2){
quiz_subt();
}
else if(opr==3){
quiz_mult();
}
}
else if (key == '#') {
quiz=false;
stringTwo="";
lcd.clear();
lcd.print(score);
lcd.print("/");
lcd.print(total);
delay(1500);
score=0;
total=0;
loop();
}
break;
}
}
```

## Schematics

This is how whole system must look like

• 9 projects
• 35 followers

#### Published on

February 12, 2017

#### Members who respect this project

and 6 others

See similar projects
you might like

#### Servo Control with TV Remote Control

Project showcase by eldo85

• 12,739 views
• 34 respects

#### Start/Stop Chronometer

Project showcase by Gabriele Scordamaglia

• 5,810 views
• 6 respects

#### Multifunctional Watch With Arduino Uno

Project showcase by shaqibmusa94

• 4,622 views
• 8 respects

#### Arduino-based Obstacle Monitoring System

Project showcase by Boaz Lawnce

• 3,595 views
• 4 respects

#### RFID Based Automatic Door System

Project showcase by Robodia Technology

• 54,726 views