Go Down

Topic: error: ambiguates old declaration 'void setup()' (Read 2241 times) previous topic - next topic


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 ()  {
 lcd.printIn("KEYPAD testing... pressing");

void loop()

 adc_key_in = analogRead(0)
 digitalWrite(13, HIGH);
 key = get_key(adc_key_in);
       if (key != oldkey)
         adc_key_in = analogRead(0);
         key = get_key(adc_key_in);
         if (key != oldkey)
           oldkey = key;
           if (key >=0){
             lcd.cursorTo(2, 0);

 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()'


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

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131