Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

MSP430G2 Launchpad Keypad Problem

$
0
0

Hello,

I tried to use my MSP430G2553 launchpad with a keypad (https://www.sparkfun.com/products/8653) using

#include <Keypad.h>

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

byte rowPins[ROWS] = { P1_5, P1_4, P1_3, P1_2 };
// Connect keypad COL0, COL1 and COL2 to these Arduino pins.
byte colPins[COLS] = { P1_0, P1_7, P1_6 };   



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

void setup(){
  Serial.begin(9600);
}
  
void loop(){
  Serial.print("Serial test\n");
    delay(100); 
  char key = keypad.getKey();
  
  if (key != NO_KEY){
    Serial.println(key);
  }
}

None of them works, they only print "Serial test" and thats when i press RESET. I tried using latest keypad library from ARDUINO site or the libraries that in those tutorials.

 

Do i need a different way to wire up the keypad to launchpad or need a different library?

Thank you. 


Viewing all articles
Browse latest Browse all 2077

Trending Articles