Show Posts
Pages: 1 ... 23 24 [25] 26
361  Community / Exhibition / Gallery / Re: Password input panel - a phi-menu example on: March 11, 2011, 03:53:10 am
Ok I cross posted this too, but from now on I'll post here about the Menu:  smiley-roll

Nice one. You know, I keep asking about that rotating arrow thing to be used in the menu, but then I released, you don't use that kind of menu.

I'm always think of a menu where you see more then 1 choice at a time. Something like this, where the arrow would change places when cycling the menu.

> GAME     . HSCORE
. CREDITS  . HOWTO

. GAME     .  HSCORE
> CREDITS  . HOWTO

. GAME     > HSCORE
. CREDITS  . HOWTO

. GAME     .  HSCORE
. CREDITS  > HOWTO

Now the reason why I would use this kind of menu is, that you know how many items you can choose of. I know it's limited this way to 4 items. BUT ...

I have seen some other approach on Alarm systems

Explanation of m        => here you have the explanation of you menu item (scrolling)
.1.2.3>4.5.6.7.8        => here the arrow shows which menu item is shown above.

This way you have a better way of knowing how many menu items there are and when you'll get at number (let's say) 5
362  Community / Exhibition / Gallery / Re: LCD 16x2 character art (posting all my char art here) on: March 11, 2011, 03:44:25 am
Nice one. You know, I keep asking about that rotating arrow thing to be used in the menu, but then I released, you don't use that kind of menu.

I'm always think of a menu where you see more then 1 choice at a time. Something like this, where the arrow would change places when cycling the menu.

> GAME     . HSCORE
. CREDITS  . HOWTO

. GAME     .  HSCORE
> CREDITS  . HOWTO

. GAME     > HSCORE
. CREDITS  . HOWTO

. GAME     .  HSCORE
. CREDITS  > HOWTO

Now the reason why I would use this kind of menu is, that you know how many items you can choose of. I know it's limited this way to 4 items. BUT ...

I have seen some other approach on Alarm systems

Explanation of m        => here you have the explanation of you menu item (scrolling)
.1.2.3>4.5.6.7.8        => here the arrow shows which menu item is shown above.

This way you have a better way of knowing how many menu items there are and when you'll get at number (let's say) 5
363  Community / Exhibition / Gallery / Re: LCD 16x2 character art (posting all my char art here) on: March 11, 2011, 02:02:11 am
Yes, I'm still very interested in a 1-button menu, so show off your cycling menu  smiley-grin.

Could you put my rotating arrow in that menu? That would probably make it a lot more difficult, wouldn't it?
364  Using Arduino / Displays / Re: LCD in Sleep mode showing zzz's on: March 10, 2011, 10:51:33 am
You should use something like this (it's like setting up an animation)

Code:
void sleep(){
  fill();
  empty();
}

void fill(){
  for (char i=0;i<17;i++){
    srlcd.print("Z");
    key = keypad.getKey();
    delay(100);
  }
}

void empty(){
  for (char i=0;i<17;i++){
    srlcd.print(" ");
    key = keypad.getKey();
    delay(100);
  }
}

if you want the empty space go from right to left, you'll have to set rightToLeft() (if you're using LiquidCrystal.h)
365  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.
366  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
367  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?
368  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
369  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
370  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)

371  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
372  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();
}
373  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
  }
}
374  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
375  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.
Pages: 1 ... 23 24 [25] 26