PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ErrorCallback.ino 450B

3 years ago
12345678910111213141516171819202122232425
  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. }