0

I have a teensy, setup as a keyboard. The data sends out fine, but the key presses need to be a longer duration. I tried adding a delay, after Keyboard.print("w"); but there was no change in durration. I have a keyboard piano, key presses make midi notes. I would like my teensy to help me send data to the piano program in interesting ways, but the key presses are too short.

Here is the page I have been referencing, https://www.pjrc.com/teensy/td_keyboard.html

and sample code from the function where I would like to extend key presses:

String piano(long cm){
 //wetyu asdfghjk

  if (cm < 13){
  switch(cm){
  case 0 : 
    //msg+="";
    Keyboard.print("w");
      break;  
  case 1 :
    //msg+="A";
    Keyboard.print("e");
      break;
  case 2 :
    //msg+="B";
    Keyboard.print("t");
      break;  
  case 3 :
    //msg+="C";
    Keyboard.print("y");
      break;
  case 4 :
    //msg+="D";
    Keyboard.print("u");
      break;  
  case 5 :
    //msg+="E";
    Keyboard.print("a");
      break;  
  case 6 :
    //msg+="F";
    Keyboard.print("s");
      break;
  case 7 :
    //msg+="G";
    Keyboard.print("d");
      break;  
  case 8 :
    //msg+="H";
    Keyboard.print("f");
    break;
  case 9 :
    //msg+="I";
    Keyboard.print("g");
      break;
  case 10 :
    //msg+="J";
    Keyboard.print("h");   
      break;
  case 11 :
    //msg+="k";
    Keyboard.print("j");   
      break;
  case 12 :
    //msg+="L";
    Keyboard.print("k");   

      break;

 default: Serial.print(" ");  

  }
    }else{

    ;
  }
}
  • 1
    Read the section "Individual Key Press / Release"... – Majenko Jun 3 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.