Silly Name Generator
Hi! My name is Nathan J. I made the Silly Name Generator! When you press the button, it takes a random first name out a list of 15 first names, then takes a last name out of a list of 15 last names!
Supplies
Includes:
Arduino Mega ADK
2 x 16 LCD Module
12mm Trimmer Potentiometer (Large)
Breadboard
A crazy amount of jumper wires, somewhere between 10 and 20 male wires
Build the Circut
Build the circuit exactly as shown in the diagram.
Copy This Code
Take the circuit, plug it into your computer, and upload this code onto the Arduino using the Arduino coding software.
//Funny Name Generator!
//By Nathan Joyce
//In theory, you can create additional names by changing the maximum number in the random variable state,
//then adding a new entry into the first or last name section.
//Run the code, then press the button to dispense a random name!
#include <LiquidCrystal.h>
LiquidCrystal lcd (7, 8, 9, 10, 11, 12);
#include "Arduino_SensorKit.h"
#define BUTTON 6
bool button_state;
int firstname=random(1,15);
int lastname=(1,15);
int buttonApin = 6;
void setup() {
lcd.begin(16, 2);
Serial.begin(9600);
pinMode(BUTTON , INPUT);
pinMode(buttonApin, INPUT_PULLUP);
// set up number of columns and rows
lcd.begin(16, 2);
}
void loop() {
//Detects when the button is pressed
Serial.println(digitalRead(buttonApin));
if (digitalRead(buttonApin) == LOW)
{
lcd.clear();
//Sets the first name and last name to a random number between 1 and 15.
int firstname=random(1,15);
int lastname=random(1,15);
//-------------------------------------------------------------------
//First Names
if (firstname==1){
lcd.setCursor(0, 0);
lcd.print("Daquon");
}
if (firstname==2){
lcd.setCursor(0, 0);
lcd.print("Daquonte");
}
if (firstname==3){
lcd.setCursor(0, 0);
lcd.print("Daquavion");
}
if (firstname==4){
lcd.setCursor(0, 0);
lcd.print("Jaquon");
}
if (firstname==5){
lcd.setCursor(0, 0);
lcd.print("Jaquonte");
}
if (firstname==6){
lcd.setCursor(0, 0);
lcd.print("Jaquavion");
}
if (firstname==7){
lcd.setCursor(0, 0);
lcd.print("Demequantre");
}
if (firstname==8){
lcd.setCursor(0, 0);
lcd.print("DaMarkus");
}
if (firstname==9){
lcd.setCursor(0, 0);
lcd.print("Randy");
}
if (firstname==10){
lcd.setCursor(0, 0);
lcd.print("Jaiven");
}
if (firstname==11){
lcd.setCursor(0, 0);
lcd.print("Quandale");
}
if (firstname==12){
lcd.setCursor(0, 0);
lcd.print("Ronnie");
}
if (firstname==13){
lcd.setCursor(0, 0);
lcd.print("Jemaquantre");
}
if (firstname==14){
lcd.setCursor(0, 0);
lcd.print("Jamal");
}
if (firstname==15){
lcd.setCursor(0, 0);
lcd.print("Randy");
}
//-------------------------------------------------------------------
//Last Names
if (lastname==1){
lcd.setCursor(0, 1);
lcd.print("Jones");
}
if (lastname==2){
lcd.setCursor(0, 1);
lcd.print("Anderson");
}
if (lastname==3){
lcd.setCursor(0, 1);
lcd.print("Frootloop");
}
if (lastname==4){
lcd.setCursor(0, 1);
lcd.print("Johnson");
}
if (lastname==5){
lcd.setCursor(0, 1);
lcd.print("Cartwheel II");
}
if (lastname==6){
lcd.setCursor(0, 1);
lcd.print("Frootloop III");
}
if (lastname==7){
lcd.setCursor(0, 1);
lcd.print("Cartwheel");
}
if (lastname==8){
lcd.setCursor(0, 1);
lcd.print("Jean-Pierre");
}
if (lastname==9){
lcd.setCursor(0, 1);
lcd.print("Schindler");
}
if (lastname==10){
lcd.setCursor(0, 1);
lcd.print("Dingle");
}
if (lastname==11){
lcd.setCursor(0, 1);
lcd.print("Octavius");
}
if (lastname==12){
lcd.setCursor(0, 1);
lcd.print("Joe");
}
if (lastname==13){
lcd.setCursor(0, 1);
lcd.print("from Fortnite");
}
if (lastname==14){
lcd.setCursor(0, 1);
lcd.print("II");
}
if (lastname==15){
lcd.setCursor(0, 1);
lcd.print("III");
}
}
}
Press the Button
When you press the button, a random name will generate! Good job! I'm sure any names generated will be 100% very silly!