Show Posts
Pages: 1 ... 23 24 [25] 26
361  Community / Exhibition / Gallery / Re: LCD 16x2 character art (posting all my char art here) on: March 10, 2011, 10:37:16 am
I have edited the code of the rotating arrow post, so that people will better understand what's happening.
362  Community / Exhibition / Gallery / Re: Password input panel - a phi-menu example on: March 10, 2011, 07:28:25 am
Well I know where they're from. Belgium: wikipedia:

Quote
The Smurfs (French: Les Schtroumpfs) is a comic and television franchise centered on a group of small blue fictional creatures called Smurfs, created by and first introduced as a series of comic strips by the Belgian cartoonist Peyo (pen name of Pierre Culliford) on October 23, 1958.

Watching the forum for your post on the phi-2-shield smiley-wink
363  Community / Exhibition / Gallery / Re: Password input panel - a phi-menu example on: March 09, 2011, 05:04:34 pm
Nice one. As you know I'm waiting for your phi-2-Shield to be ready to ship to Belgium. I'll keep a close I on your posts smiley-wink

PS: do you know where the smurfs are from?
364  Community / Exhibition / Gallery / Re: LCD 16x2 character art (posting all my char art here) on: March 09, 2011, 03:56:29 am
@liudr, wouldn't it be nice to have my rotating arrow in front of your menu items?  smiley-grin maybe, this way I can slip into the credits of your phi-menu  smiley-money just a joke.

All the code I post here is for everyone to use, just mention my name and URL
365  Community / Exhibition / Gallery / Re: LCD 16x2 character art (posting all my char art here) on: March 08, 2011, 07:40:14 am
Go ahead, use them and leave our name in the sketch as reference. Don't forget to show off your implementation  smiley-grin
366  Community / Exhibition / Gallery / Re: LCD 16x2 character art (posting all my char art here) on: March 08, 2011, 06:21:42 am
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  smiley-grin:
  • 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)

367  Community / Exhibition / Gallery / Re: LCD 16x2 character art (posting all my char art here) on: March 07, 2011, 03:14:17 pm
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
368  Community / Exhibition / Gallery / Re: LCD 16x2 character art (posting all my char art here) on: March 07, 2011, 03:10:15 pm
Didn't someone talk about a rotating arrow?



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:
/*  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();
}
369  Using Arduino / Programming Questions / Re: trying to set repeating code parts, but don't know how on: March 07, 2011, 02:50:37 pm
Quote
The * in front of a variable name (byte *arrows) means that the variable is a pointer
aha, Ok I understand your explanation and I tested the code: IT WORKS  smiley-cool

Now I cleaned up the code and I've put it here as a reference:

A rotating arrow on a 16x2 LCD
Code:
#include  <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int z = 250; // set animation speed (actual the delay between each frame of the animation)
byte arrowA1[8] = {B00000,B11000,B10100,B10010,B10010,B10100,B11000,B00000}; // set up arrow 1
byte arrowA2[8] = {B00000,B00000,B11000,B10110,B10110,B11000,B00000,B00000}; // set up arrow 2
byte arrowA3[8] = {B00000,B00000,B00000,B11110,B11110,B00000,B00000,B00000}; // set up arrow 3
byte *arrows[4]={arrowA1,arrowA2,arrowA3,arrowA2}; // set up each animation step: arrow 1, arrow 2, arrow 3, arrow 2

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

void loop() {
  for(int i=0; i<4; i++)
  {
    lcd.clear();
    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(z); // wait for z millisecs
  }
}
370  Using Arduino / Programming Questions / Re: trying to set repeating code parts, but don't know how on: March 07, 2011, 10:30:46 am
you are completly right,
Quote
why would one think that?
  smiley-grin

In my case it would just replace arrowA by 1,2,3 and 2 again and it should replace it with arrowA1, arrowA2, arrowA3, arrowA2

So I changed the

Code:
byte arrowA[]={1,2,3,2};
to
Code:
byte *arrows[4] = {arrowA1, arrowA2, arrowA3, arrowA2};
and
Code:
lcd.createChar(character, arrows[i]);
to match arrows instead of the confusing arrowA
I'll test this within 2 hours, but I think you helped me out. I tried to fill out those arrowA1 ... in byte arrows[], but it gave an error. when putting * in front of arrows it compiles sketch. Why is that? what does the * mean?

thanks again
371  Using Arduino / Programming Questions / Re: trying to set repeating code parts, but don't know how on: March 07, 2011, 09:33:23 am
Well actually the code I wrote does work and I DO have to create every char because they are 3 different drawings of an arrow.

so the part:
Code:
byte arrowA1[8] = {B00000,B11000,B10100,B10010,B10010,B10100,B11000,B00000};
byte arrowA2[8] = {B00000,B00000,B11000,B10110,B10110,B11000,B00000,B00000};
byte arrowA3[8] = {B00000,B00000,B00000,B11110,B11110,B00000,B00000,B00000};

has to stay.

It is the part where I try to put the chars on the LCD I want to simplify. I tried this, but it doesn't work:

Code:
#include  <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
byte x = 0; //set row on LCD
byte y = 0; // set column on LCD
int z = 250; // set animation speed (actual the delay between each frame of the animation)

byte arrowA1[8] = {B00000,B11000,B10100,B10010,B10010,B10100,B11000,B00000}; // set up arrow 1
byte arrowA2[8] = {B00000,B00000,B11000,B10110,B10110,B11000,B00000,B00000}; // set up arrow 2
byte arrowA3[8] = {B00000,B00000,B00000,B11110,B11110,B00000,B00000,B00000}; // set up arrow 3

byte arrowA[]={1,2,3,2}; // set up each animation step: arrow 1, arrow 2, arrow 3, arrow 2
int character = 0; // set up the character number (we can only have 8 characters at the same time on the display, but now we only need one, 0 in this case)

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

void loop() {
  for(int i=0; i<3; i++)
  {
        lcd.clear();
  lcd.createChar(character, arrowA[i]); //here we actually create the character on position character
        lcd.setCursor(x,y); // here we set the cursor on location x and y (row and column)
        lcd.write(character); // write the "characterpos" we defined in lcd.createChar to the LCD
        delay(z); // wait for z millisecs
  }

normally the
Code:
for(int i=0; i<3; i++)
should write each arrow on the same location with a delay of 250 millisecs and do this accordingly to
Code:
byte arrowA[]={1,2,3,2};
this should be: arrowA1, arrowA2, arrowA3, arrowA2, but it gives me:
sketch_mar07a.cpp: In function 'void rotatingarrow()':
sketch_mar07a:16: error: invalid conversion from 'int' to 'uint8_t*'
sketch_mar07a:16: error: initializing argument 2 of 'void LiquidCrystal::createChar(uint8_t, uint8_t*)'

one would think arrowA[] would be replaced by 1 then 2 then 3 and then 2 again.
372  Using Arduino / Programming Questions / (solved) trying to set repeating code parts, but don't know how on: March 06, 2011, 01:31:35 pm
Below you see the code for a rotating arrow. Now as you can see it is actually 3 character sets being put on after an other. Actually I need something like 123212321232 and so on, but I don't know how to do that.

Code:
#include  <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int x = 250;
int y = 0;
int z = 1;

byte arrowA1[8] = {B00000,B11000,B10100,B10010,B10010,B10100,B11000,B00000};
byte arrowA2[8] = {B00000,B00000,B11000,B10110,B10110,B11000,B00000,B00000};
byte arrowA3[8] = {B00000,B00000,B00000,B11110,B11110,B00000,B00000,B00000};

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

void loop() {
        arrow();
}

void arrow(){
        lcd.clear();
   lcd.createChar(0, arrowA1);
        lcd.setCursor(y,z);
        lcd.write(0);
        delay(x);
        lcd.createChar(0, arrowA2);
        lcd.setCursor(y,z);
        lcd.write(0);
        delay(x);
        lcd.createChar(0, arrowA3);
        lcd.setCursor(y,z);
        lcd.write(0);
        delay(x);
        lcd.createChar(0, arrowA2);
        lcd.setCursor(y,z);
        lcd.write(0);
        delay(x);  
}

What I want do do is having the part:

Code:
lcd.createChar(0, arrowA1);
        lcd.setCursor(y,z);
        lcd.write(0);
        delay(x);

only once and change the arrowA1 to arrowA2, arrowA3, arrowA2, arrowA1,arrowA2, ... well you get the point.
373  Community / Exhibition / Gallery / Re: LCD 16x2 character art (posting all my char art here) on: March 06, 2011, 06:09:16 am
Ok, so you haven't seen nothing yet  smiley-grin

@ 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.



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
374  Community / Exhibition / Gallery / Re: LCD 16x2 character art (posting all my char art here) on: March 05, 2011, 09:05:02 am
Ok and now I have the thumb moving  smiley

Code:
/*
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);
}

375  Community / Exhibition / Gallery / Re: LCD 16x2 character art (posting all my char art here) on: March 05, 2011, 08:41:02 am
And Thumbs Down

Code:
/*
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);
}

Pages: 1 ... 23 24 [25] 26