fix inverted led on/off on xiao usbmidi example

pull/14/head
midilab 2 years ago
parent 39d7b93437
commit fc050434c2
  1. 11
      examples/XiaoUsbMasterMidiClock/XiaoUsbMasterMidiClock.ino
  2. 2
      library.properties

@ -4,6 +4,9 @@
* device name on Seeedstudio XIAO M0. * device name on Seeedstudio XIAO M0.
* *
* This example code is in the public domain. * This example code is in the public domain.
*
* Tested with Adafruit TinyUSB version 0.10.5
*
*/ */
#include <Adafruit_TinyUSB.h> #include <Adafruit_TinyUSB.h>
#include <MIDI.h> #include <MIDI.h>
@ -19,13 +22,13 @@ void handle_bpm_led(uint32_t tick)
{ {
// BPM led indicator // BPM led indicator
if ( !(tick % (96)) || (tick == 1) ) { // first compass step will flash longer if ( !(tick % (96)) || (tick == 1) ) { // first compass step will flash longer
bpm_blink_timer = 4; bpm_blink_timer = 8;
digitalWrite(LED_BUILTIN, HIGH); digitalWrite(LED_BUILTIN, LOW);
} else if ( !(tick % (24)) ) { // each quarter led on } else if ( !(tick % (24)) ) { // each quarter led on
bpm_blink_timer = 1; bpm_blink_timer = 1;
digitalWrite(LED_BUILTIN, HIGH);
} else if ( !(tick % bpm_blink_timer) ) { // get led off
digitalWrite(LED_BUILTIN, LOW); digitalWrite(LED_BUILTIN, LOW);
} else if ( !(tick % bpm_blink_timer) ) { // get led off
digitalWrite(LED_BUILTIN, HIGH);
} }
} }

@ -1,5 +1,5 @@
name=uClock name=uClock
version=1.1.0 version=1.1.2
author=Romulo Silva <contact@midilab.co> author=Romulo Silva <contact@midilab.co>
maintainer=Romulo Silva <contact@midilab.co> maintainer=Romulo Silva <contact@midilab.co>
sentence=BPM clock generator for Arduino and Teensy boards sentence=BPM clock generator for Arduino and Teensy boards

Loading…
Cancel
Save