Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Bug in Keypad library on: May 08, 2011, 10:12:09 pm
I used the code you posted and i am still getting the same results, is it because i am using the waspmote IDE instead of Arduino or do i need to add anything else into my library?

Regrads.
2  Using Arduino / Programming Questions / Re: Bug in Keypad library on: May 08, 2011, 08:25:16 pm
Hi,

It is only when i exclude Keypad.h, i will have the error stated above.

If i include Keypad.h, i will have more complex errors as in the picture in the link: http://i1131.photobucket.com/albums/m542/couchpotato8/error.png

Regards.
3  Using Arduino / Programming Questions / Re: Bug in Keypad library on: May 06, 2011, 03:45:21 am
Hi Nick,

I have encountered errors while programming which is the programming line below highlighted in red, the keypad defining kpd, the program cannot read it as a type. I am using a Waspmote board instead of arduino. I placed the keypad.cpp and keypad.h file in the library and followed your instructions to rewrite the keypad library, the program manages to read the 'Keypad' defining the kpd as the colour of the 'keypad' changes. However, the error still persists. The error states : "Keypad does not name a type in function void loop()".

The following is my code:

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'#','0','*'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad

Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
  USB.begin();
}
 
void loop(){
  byte key = kpd.getKey();
 
  if (key != NO_KEY){
    USB.println(key);
  }
}

Please advice
Thanks in advance.
Pages: [1]