I have been trying to work on a project and I keep getting the error message keyboard not found did you include library Keyboard.h? I have included the library and am wondering why it won't upload any help will work.
#include <Keyboard.h>
const int indexFinger = 9; // the piezo is connected to analog pin 9 (aka #9)
const int middleFinger = 7; // the piezo is connected to analog pin 7 (aka #6)
const int thumb = 10; // the piezo is connected to analog pin 10 (aka #10)
const int pinkyFinger = 11; // the piezo is connected to analog pin 11 (aka #12)
//the aka relates to the position on the flora board.
const int pins[] = {indexFinger, middleFinger, thumb, pinkyFinger}; // I setting each of the fingers the piezo is on
char Keys[] = {'q', 'w', 'e', 'r'};// the device acts as a keyboard this is which keys it matches.
boolean currentPressed[] = {false, false, false, false};
const int threshold = 40; // threshold value to decide when the detected sound is a knock or not
void setup()
{
//while (!Serial)
Serial.begin(115200);
Serial.println("start");
Keyboard.begin();
//begin keyboard and serial
}
void loop()
{
for (int i = 0; i < 4; i++) {
delay(1);
long total1 = 0;
long start = millis();
long total = analogRead(pins*);*
- // check if we are sensing that a finger is touching*
- // and that it wasnt already pressed*
_ if ((total > threshold) && (! currentPressed*)) {_
_ Serial.print("Key pressed #"); Serial.print(i);_
_ Serial.print(" ("); Serial.print(Keys); Serial.println(")");
currentPressed = true;
Keyboard.press(Keys);
}
else if ((total <= threshold) && (currentPressed)) {
// key was released (no touch, and it was pressed before)
Serial.print("Key released #"); Serial.print(i);
Serial.print(" ("); Serial.print(Keys); Serial.println(")");
currentPressed = false;
Keyboard.release(Keys);
}
delay(5);
}
}*_