Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
ishaan1490mechatrontusham_agarwalakroid
Published © MIT

Animation Studios Mechatron Robotics

This project of ours consists of an animated binary character produced through codes which can be controlled by the user through push button

IntermediateShowcase (no instructions)532
Animation Studios Mechatron Robotics

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
Tactile Switch, Top Actuated
Tactile Switch, Top Actuated
×4

Story

Read more

Schematics

Animation Studios

This is the the schematic of our circuit. With all the hardware components included.

Code

Animation Studios

Arduino
This is the code of our creation
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2); 
int cursor=7;
const int l=10, d=9, u=8, r=7;

byte customChar[] = {
  B01110,
  B01110,
  B00100,
  B11111,
  B10101,
  B00100,
  B01010,
  B11011
};
byte customCharright[] = {
  B00111,
  B00111,
  B00100,
  B00111,
  B00110,
  B00101,
  B01010,
  B01001
};
byte customCharleft[] = {
  B11100,
  B11100,
  B00100,
  B11100,
  B01100,
  B10100,
  B01010,
  B10010
};
byte customCharup[] = {
  B01110,
  B01110,
  B10101,
  B01110,
  B00100,
  B00100,
  B01010,
  B11011
};
byte left[] = {
  B00100,
  B00010,
  B00001,
  B11111,
  B11111,
  B00001,
  B00010,
  B00100
};
byte right[] = {
  B00100,
  B01000,
  B10000,
  B11111,
  B11111,
  B10000,
  B01000,
  B00100
};

void setup() {
  lcd.begin(16, 2);
  pinMode(l, INPUT);
  pinMode(r, INPUT);
  pinMode(u, INPUT);
  pinMode(d, INPUT);
  lcd.createChar(0, customChar);
  lcd.createChar(1, left);
  lcd.createChar(2, right);
  lcd.createChar(3, customCharright);
  lcd.createChar(4, customCharleft);
  lcd.createChar(5, customCharup);
  lcd.home();
  lcd.print("Mechatron");
  lcd.setCursor(8,1);
  lcd.print("Robotics");
  delay(2000);
  for(int i=0; i<16; i++)
  {
    lcd.clear();
    lcd.setCursor(i,0);
    lcd.write(byte(1));
    delay(50);
  }
  for(int i=16; i>=0; i--)
  {
    lcd.clear();
    lcd.setCursor(i,1);
    lcd.write(byte(2));
    delay(50);
  }
  lcd.clear();
}

void loop() {
  //lcd.clear();
  lcd.setCursor(cursor,0);
  lcd.write(byte(0));
  lcd.setCursor(4,1);
  lcd.print("Move Me");
  delay(20);
  if(digitalRead(r) == HIGH)
  {
    if (cursor>=0 && cursor<16)
    {
      cursor++;
      lcd.clear();
      lcd.setCursor(cursor,0);
      lcd.write(byte(3));
      delay(200);
    }
  }
  
  if(digitalRead(l) == HIGH)
  {
    if (cursor>=0 && cursor<16)
    {
      cursor--;
      lcd.clear();
      lcd.setCursor(cursor,0);
      lcd.write(byte(4));
      delay(200);
    }
  }
  if(digitalRead(u) == HIGH)
  {
    if (cursor>=0 && cursor<16)
    {
      lcd.clear();
      lcd.setCursor(cursor,0);
      lcd.write(byte(5));
      delay(200);
    }
  }
  if(digitalRead(d) == HIGH)
  {
      lcd.clear();
      lcd.setCursor(cursor,1);
      lcd.write(byte(0));
      delay(200);
    
  }
}

Credits

ishaan1490mechatron
0 projects • 0 followers
Contact
tusham_agarwal
0 projects • 3 followers
Contact
akroid
0 projects • 5 followers
Contact

Comments

Please log in or sign up to comment.