NameSmasher

by JeremyHa in Circuits > Tools

1161 Views, 7 Favorites, 0 Comments

NameSmasher

image.jpg

Namesmasher- the smashing of 2 names!!!!!!

Introduction

This project is very simple, now that I did it. Basically, what you have to do is connect a LCD and 2 buttons to the Arduino and then BAM you got a namesmasher. A namesmasher happens when you press a button and then one name blinks, same with the other. But when you press both simultaneously, both names will pop up until you let go.

Materials:

C8DD62D9-2E86-4A36-8142-EAC3EBC3ADFE.jpeg
233B366A-B5EA-4165-A040-B93D3E9BE21A.jpeg
3E10AE7D-DE0A-4D0B-B324-5C4872075257.jpeg
8824D128-9151-4E85-B242-7B7667CBC754.jpeg
0D4B4702-DFEE-487F-9F06-204DD7430BB4.jpeg
C04BF6F3-2529-4613-9FED-0EE06F12966C.jpeg
1B5D5DA1-B9F7-4AE5-85B4-A290FC479474.jpeg

All you need is:

6 male wires;

4 female wires;

2 resistors;

2 buttons;

an Arduino;

an LCD liquid crystal display;

and a breadboard.

Setup

Screen Shot 2017-12-14 at 8.10.58 PM.png
image.jpg
image.jpg
image.jpg
image.jpg
5AD46C49-EDA7-44C8-A0CA-36FD8E5F47CC.jpeg
4FD0EE14-2E57-4B81-8721-5FDA9417AFEA.jpeg
75C1A0F2-3586-4E07-B96A-32E605C3466D.jpeg

How to set up the LCD liquid crystal display;

As you can see in the picture you have to connect GND, VCC, SDA, and SCL to its corresponding point on the Arduino.

Code

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 2, 1 , 0, 4, 5, 6, 7, 3, POSITIVE);

int votes[4]={0,0,0,0};

char inbyte;

String pwd="VOTE";

String inpt="";

boolean flag=false;

boolean securitygranted=false;

int i;

int buttonstate1 = 0; //setting buttonstates to 0

int buttonstate2 = 0;

int buttonstate3= 0;

int buttonstate4= 0;

void setup() {

pinMode(2, INPUT); //Inputs

pinMode(3, INPUT);

lcd.begin(16, 2);

lcd.display();

Serial.begin(9600);

Serial.println("ENTER PASSWORD");

}

void loop(){

lcd.setCursor(0,0);

buttonstate3= digitalRead(2); //reading the buttons

buttonstate4= digitalRead(3);

Serial.print(buttonstate3);

Serial.print(buttonstate4);

if (buttonstate3 == 1){ //if buttonstate is at 1

lcd.write("Gaya"); //Print this onto the LCD screen

delay(100); }

if (buttonstate4 == 1){ //if buttonstate is at 1

lcd.write("Jeremy"); //Print this onto the LCD screen

delay(100);

} if (buttonstate3 == 0){ //if buttonstate is at 0

lcd.clear(); //Clear the LCD screen

delay(100); }

if (buttonstate4 == 0){

lcd.clear(); delay(100);

}

}

Conclusion

IMG 5740 4

So after all this, I am here to say that you can make this project even cooler than what I did. You can add more buttons so you can print more names. You could make it be a voting system. Try adding two (etc.) LCDs and experiment with that. There are so many things that you could do with this idea.

Good luck and happy holidays!!