Hello.
I have downloaded this code:
#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 kpd
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the kpd
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
unsigned long loopCount;
unsigned long startTime;
String msg;
void setup() {
Serial.begin(9600);
loopCount = 0;
startTime = millis();
msg = "";
}
void loop() {
loopCount++;
if ( (millis()-startTime)>5000 ) {
Serial.print("Average loops per second = ");
Serial.println(loopCount/5);
startTime = millis();
loopCount = 0;
}
// Fills kpd.key[ ] array with up-to 10 active keys.
// Returns true if there are ANY active keys.
if (kpd.getKeys())
{
for (int i=0; i<LIST_MAX; i++) // Scan the whole key list.
{
if ( kpd.key*.stateChanged ) // Only find keys that have changed state.*
- {*
_ switch (kpd.key*.kstate) { // Report active key state : IDLE, PRESSED, HOLD, or RELEASED*_
* case PRESSED:*
* msg = " PRESSED.";*
* break;*
* case HOLD:*
* msg = " HOLD.";*
* break;*
* case RELEASED:*
* msg = " RELEASED.";*
* break;*
* case IDLE:*
* msg = " IDLE.";*
* }*
* Serial.print("Key ");*
_ Serial.print(kpd.key*.kchar);
Serial.println(msg);
}
}
}
} // End loop*
And when I test it than it showes this:
Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
sketch_jan27a:1:20: error: Keypad.h: No such file or directory
compilation terminated.
exit status 1
Keypad.h: No such file or directory
Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.
Any idea_