Pages: [1]   Go Down
Author Topic: error: ambiguates old declaration 'void setup()'  (Read 1559 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well... i just get started with arduino.. the tools i use is....
Hardware:Arduino duemilanove& Arduino LCD&KeyPad Shield
Software:arduino-0018 addon a libraries LCD4Bit
i was just using the example code... but come out a error.. and i dunno how to fix it ;D can any expert lend a hand?

============================================
#include <LCD4Bit.h>

LCD4Bit lcd = LCD4Bit_(2)

char msgs [5][15] = {"Right Key OK ",
                     "Up Key OK    ",
                     "Down Key OK  ",
                     "Left Key OK  ",
                     "Select Key OK  ",
int adc_key_val[5]  ={30, 150, 360, 535, 760  };

int NUM_KEYS  =  5;

int adc_key_in;

int key=-1;

int oldkey=-1;

int setup ()  {
  
  pinMode(13,OUTPUT);
  
  lcd.init();
  
  lcd.clear();
  
  lcd.printIn("KEYPAD testing... pressing");
}

void loop()

{
  adc_key_in = analogRead(0)
  digitalWrite(13, HIGH);
  key = get_key(adc_key_in);
        if (key != oldkey)
        {
          delay(50);
          adc_key_in = analogRead(0);
          key = get_key(adc_key_in);
          if (key != oldkey)
          {
            oldkey = key;
            if (key >=0){
              lcd.cursorTo(2, 0);
              lcd.printIn(msgs[key]);
            }
          }
        }
        digitalWrite(13,LOW);
}

{
  int k;
  for (k = 0; k< NUM_KEYS; k++)
  {
    if (input<adc_key_val[k])
    { return k;}
  }
  if (k >= NUM_KEYS)
      k= -1;
   return k;
}
============================================
error: new declaration 'int setup()'C:\Users\Demonx5\Desktop\Arduino Project\arduino-0018\hardware\arduino\cores\arduino/wiring.h:126: error: ambiguates old declaration 'void setup()'
============================================
                    
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26496
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
int setup ()  {

That's "void setup"
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: [1]   Go Up
Jump to: