Go Down

Topic: LCD 16x2 character art (posting all my char art here) (Read 48556 times) previous topic - next topic

JO3RI

Mar 05, 2011, 01:48 pm Last Edit: Mar 09, 2011, 03:27 pm by JO3RI Reason: 1
Ok So I'll make one topic in which I will show all my Character art. Maybe someone can use a piece.

Here goes Thumbs Up

Code: [Select]
/*
Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
library works with all LCD displays that are compatible with the Hitachi HD44780 driver.

This sketch is used for testing the lcd.createChar function.

TITLE: Thumbs Up

Demo by JO3RI

www.JO3RI.be/arduino
*/

// include the library code:
#include  <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins:
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16,2);
// clear the LCD screen:
lcd.clear();
}


void loop() {
// start the Thumbs Up part:
thumbsup();
}    

void thumbsup() {
 byte thumb1[8] = {B00100,B00011,B00100,B00011,B00100,B00011,B00010,B00001};
 byte thumb2[8] = {B00000,B00000,B00000,B00000,B00000,B00000,B00000,B00011};
 byte thumb3[8] = {B00000,B00000,B00000,B00000,B00000,B00000,B00001,B11110};
 byte thumb4[8] = {B00000,B01100,B10010,B10010,B10001,B01000,B11110,B00000};
 byte thumb5[8] = {B00010,B00010,B00010,B00010,B00010,B01110,B10000,B00000};
 byte thumb6[8] = {B00000,B00000,B00000,B00000,B00000,B10000,B01000,B00110};
 lcd.createChar(0, thumb1);
 lcd.createChar(1, thumb2);
 lcd.createChar(2, thumb3);
 lcd.createChar(3, thumb4);
 lcd.createChar(4, thumb5);
 lcd.createChar(5, thumb6);
 lcd.setCursor(4,1);
 lcd.write(0);
 lcd.setCursor(4,0);
 lcd.write(1);
 lcd.setCursor(5,1);
 lcd.write(2);
 lcd.setCursor(5,0);
 lcd.write(3);
 lcd.setCursor(6,1);
 lcd.write(4);
 lcd.setCursor(6,0);
 lcd.write(5);
}


and the picture:


JO3RI

#1
Mar 05, 2011, 02:41 pm Last Edit: Mar 09, 2011, 03:28 pm by JO3RI Reason: 1
And Thumbs Down

Code: [Select]
/*
Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
library works with all LCD displays that are compatible with the Hitachi HD44780 driver.

This sketch is used for testing the lcd.createChar function.

TITLE: Thumbs Down

Demo by JO3RI

www.JO3RI.be/arduino
*/

// include the library code:
#include  <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins:
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16,2);
// clear the LCD screen:
lcd.clear();
}


void loop() {
// start the Thumbs Down part:
thumbdown();
}    

void thumbdown() {
 byte thumb1[8] = {B00001,B00010,B00011,B00100,B00011,B00100,B00011,B00100};
 byte thumb2[8] = {B00011,B00000,B00000,B00000,B00000,B00000,B00000,B00000};
 byte thumb3[8] = {B11110,B00001,B00000,B00000,B00000,B00000,B00000,B00000};
 byte thumb4[8] = {B00000,B11110,B01000,B10001,B10010,B10010,B01100,B00000};
 byte thumb5[8] = {B00000,B10000,B01110,B00010,B00010,B00010,B00010,B00010};
 byte thumb6[8] = {B00110,B01000,B10000,B00000,B00000,B00000,B00000,B00000};
 lcd.createChar(0, thumb1);
 lcd.createChar(1, thumb2);
 lcd.createChar(2, thumb3);
 lcd.createChar(3, thumb4);
 lcd.createChar(4, thumb5);
 lcd.createChar(5, thumb6);
 lcd.setCursor(4,0);
 lcd.write(0);
 lcd.setCursor(4,1);
 lcd.write(1);
 lcd.setCursor(5,0);
 lcd.write(2);
 lcd.setCursor(5,1);
 lcd.write(3);
 lcd.setCursor(6,0);
 lcd.write(4);
 lcd.setCursor(6,1);
 lcd.write(5);
}



JO3RI

Ok and now I have the thumb moving  :)

Code: [Select]
/*
Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
library works with all LCD displays that are compatible with the Hitachi HD44780 driver.

This sketch is used for testing the lcd.createChar function.

TITLE: Thumbs Down MOVING

Demo by JO3RI

www.JO3RI.be/arduino
*/

// include the library code:
#include  <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins:
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// setting animation speed (delay between frames)
int x = 500;

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16,2);
// clear the LCD screen:
lcd.clear();
}


void loop() {
// start the Thumbs Down part:
thumbdownA();
        delay(x);
        lcd.clear();
        thumbdownB();
        delay(x);
        lcd.clear();
}     

void thumbdownA() {
  byte thumb1[8] = {B00001,B00010,B00011,B00100,B00011,B00100,B00011,B00100};
  byte thumb2[8] = {B00011,B00000,B00000,B00000,B00000,B00000,B00000,B00000};
  byte thumb3[8] = {B11110,B00001,B00000,B00000,B00000,B00000,B00000,B00000};
  byte thumb4[8] = {B00000,B11110,B01000,B10001,B10010,B10010,B01100,B00000};
  byte thumb5[8] = {B00000,B10000,B01110,B00010,B00010,B00010,B00010,B00010};
  byte thumb6[8] = {B00110,B01000,B10000,B00000,B00000,B00000,B00000,B00000};
  lcd.createChar(0, thumb1);
  lcd.createChar(1, thumb2);
  lcd.createChar(2, thumb3);
  lcd.createChar(3, thumb4);
  lcd.createChar(4, thumb5);
  lcd.createChar(5, thumb6);
  lcd.setCursor(4,0);
  lcd.write(0);
  lcd.setCursor(4,1);
  lcd.write(1);
  lcd.setCursor(5,0);
  lcd.write(2);
  lcd.setCursor(5,1);
  lcd.write(3);
  lcd.setCursor(6,0);
  lcd.write(4);
  lcd.setCursor(6,1);
  lcd.write(5);
}

void thumbdownB() {
  byte thumb1[8] = {B00000,B00001,B00010,B00011,B00100,B00011,B00100,B00011};
  byte thumb2[8] = {B00100,B00011,B00000,B00000,B00000,B00000,B00000,B00000};
  byte thumb3[8] = {B00000,B11110,B00001,B00000,B00000,B00000,B00000,B00000};
  byte thumb4[8] = {B00000,B00000,B11110,B01000,B10001,B10010,B10010,B01100};
  byte thumb5[8] = {B00000,B00000,B10000,B01110,B00010,B00010,B00010,B00010};
  byte thumb6[8] = {B00010,B00110,B01000,B10000,B00000,B00000,B00000,B00000};
  lcd.createChar(0, thumb1);
  lcd.createChar(1, thumb2);
  lcd.createChar(2, thumb3);
  lcd.createChar(3, thumb4);
  lcd.createChar(4, thumb5);
  lcd.createChar(5, thumb6);
  lcd.setCursor(4,0);
  lcd.write(0);
  lcd.setCursor(4,1);
  lcd.write(1);
  lcd.setCursor(5,0);
  lcd.write(2);
  lcd.setCursor(5,1);
  lcd.write(3);
  lcd.setCursor(6,0);
  lcd.write(4);
  lcd.setCursor(6,1);
  lcd.write(5);
}


http://www.youtube.com/watch?v=zh5pJ3bgCEw

Simpson_Jr

^-^

I had seen your code, but.... didn't see much in those 00001100- data lines, this looks great though !

liuzengqiang

Looks great! Can I see a fist flying from the right all the way to the left and hit something?  :D

I've been pretty much using the characters and very limited custom characters. Now to think of it, you can make an arrow that rolls around in one character space. I'll be doing it now and post back!!

JO3RI

#5
Mar 06, 2011, 12:09 pm Last Edit: Mar 06, 2011, 01:15 pm by JO3RI Reason: 1
Ok, so you haven't seen nothing yet  :D

@ Simpson_Jr: you'll have to read a bit more on Character creating. watch this link, It might help: http://icontexto.com/charactercreator/. Mind you, you can only have 8 of those at once on the LCD screen.

@liudr: you want to see a fist fly? watch this, it's even better.

http://www.youtube.com/watch?v=eq_0PQGsbHo

and of course the code:

Mmm, seems its to long to post here. I made a project page of this on my website:

http://www.jo3ri.be/arduino/arduino-projects/lcd-16x2-running-man

Simpson_Jr


Ok, so you haven't seen nothing yet  :D

@ Simpson_Jr: you'll have to read a bit more on Character creating. watch this link, It might help: http://icontexto.com/charactercreator/. Mind you, you can only have 8 of those at once on the LCD screen.


I knew that, I even made a dull 1-char smiley with flashing nose and a level indicator. Your work simply looks great, that's the difference.


Mmm, seems it to long to post here. I'll make a project page of this on my website and I'll edit this post with the link


I guess nobody would mind having it on the playground as well....

JO3RI

#7
Mar 07, 2011, 09:10 pm Last Edit: Mar 10, 2011, 04:38 pm by JO3RI Reason: 1
Didn't someone talk about a rotating arrow?

http://www.youtube.com/watch?v=DfC-w6-3mLY

I managed to simplify the code. You can read about this process in this forum post:
http://arduino.cc/forum/index.php/topic,54550.0.html
and here you have the code:
Code: [Select]

/*  For the animation of the arrow we use 4 frames, of which only 3 frames are different.
   We are using frame 2 two times. In *arrow[4] we set up the frame order.
   for(char i=0; i<4; i++) means, do this 4 times and each time "i" will be 1 more.
   So the first time i=0 and arrows[i] will be arrowA1.
   The secend time i=1 and arrows[i] will be arrowA2 and so on till i=3 (i<4)
    Rotating Arrow by JO3RI
    http://www.JO3RI.be/arduino
*/
#include  <LiquidCrystal.h>

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

void Rarrow() {
 for(char i=0; i<4; i++) // go trough this part 4 times.
 {
   byte arrowA1[8] = { // set up arrow frame 1, look at the 0's and the 1's
     B00000, // ?????
     B11000, // ?????
     B10100, // ?????
     B10010, // ?????
     B10010, // ?????
     B10100, // ?????
     B11000, // ?????
     B00000};// ?????
   byte arrowA2[8] = { // set up arrow frame 2, look at the 0's and the 1's
     B00000, // ?????
     B00000, // ?????
     B11000, // ?????
     B10110, // ?????
     B10110, // ?????
     B11000, // ?????
     B00000, // ?????
     B00000};// ?????
   byte arrowA3[8] = { // set up arrow frame 3, look at the 0's and the 1's
     B00000, // ?????
     B00000, // ?????
     B00000, // ?????
     B11110, // ?????
     B11110, // ?????
     B00000, // ?????
     B00000, // ?????
     B00000};// ?????
   byte *arrows[4]={arrowA1,arrowA2,arrowA3,arrowA2}; // set up each animation step: frame 1, frame 2, frame 3, frame 2
   lcd.createChar(0, arrows[i]); //here we actually create the character on position zero
   lcd.setCursor(0,0); // here we set the cursor on location x and y (row and column)
   lcd.write(0); // write the character we defined in lcd.createChar to the LCD
   delay(250); // wait for 250 millisecs
 }
}

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

void loop(){
 Rarrow();
}

JO3RI

#8
Mar 07, 2011, 09:14 pm Last Edit: Mar 08, 2011, 11:54 am by JO3RI Reason: 1
I can't see the video in may last post, or can you only put 4 youtube links in one topic?

*EDIT: never mind, I used IMG for URL, solved

liuzengqiang


JO3RI

Very nice thing you made, very nice. did you post the code somewhere?

I'm thinking on making 1 button games (you know, like those iPhone games). If you are interested, let me know on PM.

I would make follow things:

- intro screen (graphic with text)
- menu (with one button, you just let the choice rotate every 2 seconds and click when you choose)

  • Play

  • HowToP

  • Options

  • Credits



I have 3 games in mind starting with one, will be hard enough  :D:

  • Running man (jump in time by pressing the button)

  • Downhill (evade obstacles up or down by pressing the button)

  • shoot in time (shoot passing obstacles by pressing the button)



FEDERICO

I like the animations a lot! I want to use them in my next project! Sooo coool !
Fede
Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

JO3RI

Go ahead, use them and leave our name in the sketch as reference. Don't forget to show off your implementation  :D

liuzengqiang

Here is the link to my blog with the code. Most importantly, step-by-step of how to use my phi-menu system to create easy menu items and asks user inputs. The phi-menu software is working on my Phi-1 shield or Phi-2 shield. The software is a pre-release. I want to release it formally when my Phi-2 shield is on the shelf for sale:)

http://liudr.wordpress.com/2011/03/08/arduino-character-art-on-lcd/

If you're interested in getting a Phi-1 shield, here it is. The kit is out of stock but the list of items on the page tells you what to buy. Since you have an LCD, you could just buy the PCB and the rest of the parts, if you want it.

JO3RI

@liudr, wouldn't it be nice to have my rotating arrow in front of your menu items?  :D maybe, this way I can slip into the credits of your phi-menu  $) just a joke.

All the code I post here is for everyone to use, just mention my name and URL

Go Up