MIDI KEYBOARD

hello guys, i was building midi keyboard. i found you code here on forum

#include <Keypad.h>

const byte ROWS = 8; //eight rows
const byte COLS = 8; //eight columns

char hexaKeys[COLS][ROWS] = {
{‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’},
{‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ‘O’, ‘P’},
{‘Q’, ‘R’, ‘S’, ‘T’, ‘U’, ‘V’, ‘W’, ‘X’},
{‘Y’, ‘Z’, ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’},
{‘6’, ‘7’, ‘8’, ‘9’, ‘a’, ‘b’, ‘c’, ‘d’},
{‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’},
{‘m’, ‘n’, ‘o’, ‘p’, ‘q’, ‘r’, ‘s’, ‘t’},
{‘u’, ‘v’, ‘w’, ‘x’, ‘y’, ‘z’, ‘!’, ‘@’}
};
byte colPins[ROWS] = {5, 6, 7, 8, 9, 10, 11, 12}; //connect to the row pinouts of the keypad
byte rowPins[COLS] = {A0, A1, A2, A3, A4, A5, A6, A7}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

void setup() {
Serial.begin(9600);
}

void loop() {
char customKey = customKeypad.getKey();

if (customKey) {
Serial.println(customKey);
}
}

but i have 6 row and 8 cols: 6 in digital and 8 in analog,also i want to add release and MIDI USB code, i am trying to modify code but i can’t. please can you guys help me out. thanks in advance

You can start by modifying this

const byte ROWS = 8; //eight rows
const byte COLS = 8; //eight columns

I did but it says error: too many initializers for 'char [6]' even if i delete last two rows, if i do wrong i'm just rookie sorry

Attache the error report. Use code tags. To be sure, attache the code,

#include <Keypad.h>

const byte ROWS = 6; //six rows
const byte COLS = 8; //eight columns

char hexaKeys[COLS][ROWS] = {
{‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’},
{‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ‘O’, ‘P’},
{‘Q’, ‘R’, ‘S’, ‘T’, ‘U’, ‘V’, ‘W’, ‘X’},
{‘Y’, ‘Z’, ‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’},
{‘6’, ‘7’, ‘8’, ‘9’, ‘a’, ‘b’, ‘c’, ‘d’},
{‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’},
};
byte colPins[ROWS] = {5, 6, 7, 8, 9, 10}; //connect to the row pinouts of the keypad
byte rowPins[COLS] = {A0, A1, A2, A3, A4, A5, A6, A7}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

void setup() {
Serial.begin(9600);
}

void loop() {
char customKey = customKeypad.getKey();

if (customKey) {
Serial.println(customKey);
}
}

this is the code i modified and error message is

Arduino: 1.8.10 (Mac OS X), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
};
^
sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
sketch_jan17a:14:48: error: too many initializers for ‘byte [6] {aka unsigned char [6]}’
byte colPins[ROWS] = {5, 6, 7, 8, 9, 10, 11, 12}; //connect to the row pinouts of the keypad
^
Multiple libraries were found for “Keypad.h”
Used: /Users/macbook/Documents/Arduino/libraries/Keypad
exit status 1
too many initializers for ‘char [6]’

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

You works too fast.

Check this:

const byte ROWS = 6; //six rows
 byte colPins[ROWS] = {5, 6, 7, 8, 9, 10, 11, 12}; //connect to the row pinouts of the keypad
                                                ^

And, please, use code tags, up, to left inthis window.

Still the same error, too many initializers for 'char[6]'

What changes did You make reading my answer?
Code and error report, using code tags please.

i just copied your code as i said i don’t a word in programing, i can’t get service and can’t learn, cause it’s too hard for me. i am just musician and want build simple MIDI keyboard, when i started this project i didn’t know it could take this amount of time and also i didn’t want to bother someone. like you guys on forum.

#include <Keypad.h>

const byte ROWS = 6; //six rows
const byte COLS = 8; //eight columns

char hexaKeys[COLS][ROWS] = {
{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'},
{'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'},
{'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X'},
{'Y', 'Z', '0', '1', '2', '3', '4', '5'},
{'6', '7', '8', '9', 'a', 'b', 'c', 'd'},
{'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l'}
};
byte colPins[ROWS] = {5, 6, 7, 8, 9, 10, 11, 12}; //connect to the row pinouts of the keypad
byte rowPins[COLS] = {A0, A1, A2, A3, A4, A5, A6, A7}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

void setup() {
Serial.begin(9600);
}

void loop() {
char customKey = customKeypad.getKey();

if (customKey) {
  Serial.println(customKey);
}
}

error message:Arduino: 1.8.10 (Mac OS X), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
};
^
sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
sketch_jan17a:13:1: error: too many initializers for ‘char [6]’
sketch_jan17a:14:48: error: too many initializers for ‘byte [6] {aka unsigned char [6]}’
byte colPins[ROWS] = {5, 6, 7, 8, 9, 10, 11, 12}; //connect to the row pinouts of the keypad
^
Multiple libraries were found for “Keypad.h”
Used: /Users/macbook/Documents/Arduino/libraries/Keypad
exit status 1
too many initializers for ‘char [6]’

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

Okey. Maybe You can find a coding experienced friend to help You. I will not read and penetrate Your entire code.

If You read my previous answer again You will see that You defined "ROWS" to contain 6 elements. Then You try to push 8 elements into that array sized for 6.

Yes you absolutely right, i can't understand any words. thank you, it's my fault i couldn't understand anything.

The business of coding is fun for a lot of people. They enjoy learning, correcting errors, until the projet works. Other members just want their stuff to work. I don't want to be rude, to be ruff, but either You pick up the work of learning some coding or You go to the "toy shop", buying ready equipment.

Myself I once spent a hole year, changing the code, rebuilding the hardware in order to make it work. Then, suddenly, I woke up in the middle of night and new, remembered a hardware signal I left out 3 years earlier.