Go Down

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

NewbieController

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

AWOL

"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