PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

26 行
450B

  1. #include <MIDI.h>
  2. // Before running the program below, make sure you set
  3. // UseReceiverActiveSensing (optionally UseSenderActiveSensing) in Settings.h to true
  4. MIDI_CREATE_DEFAULT_INSTANCE();
  5. void handleError(int8_t err)
  6. {
  7. digitalWrite(LED_BUILTIN, (err == 0)? LOW : HIGH);
  8. }
  9. void setup()
  10. {
  11. pinMode(LED_BUILTIN, OUTPUT);
  12. digitalWrite(LED_BUILTIN, LOW);
  13. MIDI.setHandleError(handleError);
  14. MIDI.begin(1);
  15. }
  16. void loop()
  17. {
  18. MIDI.read();
  19. }