mmgamitoc
Published

REEE Machine v2.0

Why shout reeeeee for yourself when you can have a machine displaying that for you!?

BeginnerWork in progress874
REEE Machine v2.0

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Pushbutton
×1
USB-A to B Cable
USB-A to B Cable
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

ree machine

just press the button

Code

Reee machine

Arduino
// ree machine


#include <LiquidCrystal.h>

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

const int reeDelay = 50;

int n = 0;
int c = 1;
int state = 0;
int welcome = 0;
int button;


byte customChar[] = {     //bold E
  B11111,
  B11111,
  B11000,
  B11111,
  B11111,
  B11000,
  B11111,
  B11111
};

byte customChar2[] = {      //bold R
  B11110,
  B11011,
  B11011,
  B11110,
  B11100,
  B11110,
  B11011,
  B11001
};


void setup() {

  Serial.begin(9600);
  lcd.begin(16, 2);
  lcd.print("----------------");
  lcd.display();
  delay(500);
  lcd.clear();
  lcd.createChar(1, customChar);
  lcd.createChar(2, customChar2);
  lcd.home();
}

void loop() {
  button = analogRead(A0);
  Serial.print(button);
  Serial.print("\n");
  Serial.print(state);
  Serial.print("\n");
  
  if (button > 1020 && state == 0){
    lcd.clear();
    state = 1;
    welcome = 0;
    delay(1000);
  }
  else if (state == 1 && button <= 1020){
    Serial.print("elseif1   ");
    ree();
  }
  else if (state == 1 && button > 1020){
    Serial.print("elseif2");
    state = 0;
    n = 0;
    c = 1;
    lcd.clear();
    delay(1000);
  }
  else if (state == 0 && button <= 1020 && welcome == 0){
    Serial.print("elseif3");
    lcd.write("->PRESS TO REE<-");
    lcd.setCursor(0, 1);
    lcd.write("ree machine v2.0");
    welcome = 1;
  }
}




void ree() {
  Serial.print("ree on   ");
  
  if (n==0 && c==1){
    lcd.write(2);
    n= n + 1;
  }
  
  if (n < 16){
    lcd.write(1);
    n= n + 1;
  }
  
  else if (n == 16 && c == 1){
    c=2;
    n=0;
    lcd.setCursor(0,1);
  }
  
  else if (c==2 && n==16){
    delay(200);
    lcd.clear();
    c=1;
    n=0;
    delay(500);
  }
  
  delay(reeDelay);
}

Credits

mmgamitoc
1 project • 3 followers
Contact

Comments

Please log in or sign up to comment.