i have solder male header pins to teensy lc in this way
my 4 pins are reserve for
because of when i tried matrix of 11 r X 6 c = 66 keys with below code
without connect or touch to any pin of teensy lc, i not found any poblem in serial monitor got only
but when i add 3 more rows pins to get total 84 keys with code
i am getting in detect event in Serial monitor forever
i think key 67 is related to 12th row . i also tried replace 12th row pin with pins (13,14,17,20,21 )
but no changes . same above result found.
?? is there keys number are limited to 66 keys??
?? may it pin soldering mistake??
but after soldering my board is running well.
?? is there a prog/ code to test each pins is working or not working seprately for teensy lc.??
plaese test my code with matrix of 14x6 for teensy lc if possible .
?? what should i do here next ??
thank you.....
my 4 pins are reserve for
0 and 1 for midi , 18,19 for i2c display , next i want to use 20 pins of teensy lc in as keypad pins (14rowX6col=84 keys). but there is trouble with pins .because of when i tried matrix of 11 r X 6 c = 66 keys with below code
C++:
#include <Keypad.h>
#include <MIDI.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
const byte ROWS = 11; //
const byte COLS = 6; //
char keys[ROWS][COLS] = {
{ 1, 2, 3, 4, 5, 6},
{ 7, 8, 9,10,11,12},
{13,14,15,16,17,18},
{19,20,21,22,23,24},
{25,26,27,28,29,30},
{31,32,33,34,35,36},
{37,38,39,40,41,42},
{43,44,45,46,47,48},
{49,50,51,52,53,54},
{55,56,57,58,59,60},
{61,62,63,64,65,66}
};
byte rowPins[ROWS] = {2,3,4,5,6,7,8,9,10,11,12 }; //
byte colPins[COLS] = {21,22,23,24,25,26}; //
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
MIDI_CREATE_DEFAULT_INSTANCE();
void setup() {
Serial.begin(9600);
Serial.print ("KeyPad Test"); delay(2000);
}
void loop() {
if (kpd.getKeys())
{
for (int i=0; i<LIST_MAX; i++) // Scan the whole key list.
{ int mykey = kpd.key[i].kchar;
if ( kpd.key[i].stateChanged ) // Only find keys that have changed state. [1-48keys]
{
switch (kpd.key[i].kstate) { // Report active key state : IDLE, PRESSED, HOLD, or RELEASED
case PRESSED:
Serial.print(mykey); Serial.println(" pressed");
break;
case RELEASED:
Serial.print(mykey); Serial.println(" releassed");
break;
}
}
}
}
}// End loop
KeyPad Test and wait for new key event .but when i add 3 more rows pins to get total 84 keys with code
C++:
const byte ROWS = 14; //
const byte COLS = 6; //
char keys[ROWS][COLS] = {
{ 1, 2, 3, 4, 5, 6},
{ 7, 8, 9,10,11,12},
{13,14,15,16,17,18},
{19,20,21,22,23,24},
{25,26,27,28,29,30},
{31,32,33,34,35,36},
{37,38,39,40,41,42},
{43,44,45,46,47,48},
{49,50,51,52,53,54},
{55,56,57,58,59,60},
{61,62,63,64,65,66},
{67,68,69,70,71,72},
{73,74,75,76,77,78},
{79,80,81,82,83,84}
};
byte rowPins[ROWS] = {2,3,4,5,6,7,8,9,10,11,12,13,15,16 }; //
byte colPins[COLS] = {21,22,23,24,25,26}; //
Code:
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
67 pressed
but no changes . same above result found.
?? is there keys number are limited to 66 keys??
?? may it pin soldering mistake??
but after soldering my board is running well.
?? is there a prog/ code to test each pins is working or not working seprately for teensy lc.??
plaese test my code with matrix of 14x6 for teensy lc if possible .
?? what should i do here next ??
thank you.....