From 3bc8c9123121fb959d3905f813cdab0649d3a8fa Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Sat, 23 Sep 2023 22:19:02 +0300 Subject: [PATCH] added midi clock out --- Software/Gravity/Gravity.ino | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Software/Gravity/Gravity.ino b/Software/Gravity/Gravity.ino index 4eb46f7..a1860c3 100644 --- a/Software/Gravity/Gravity.ino +++ b/Software/Gravity/Gravity.ino @@ -5,11 +5,10 @@ #include #include -const char version[5] = "V:1.0"; +const char version[5] = "MIDI Test"; #define SCREEN_ADDRESS 0x3C - #define PPQN 24 #define PULSE_LENGTH 12 //ms (with 12 ms you can't get higher than 208bpm) #define MAXBPM 200 //250 at 24ppqn with 5ms pulse will be 50/50 square wave @@ -183,6 +182,7 @@ const uint8_t fabryka[450] U8G2_FONT_SECTION("fabryka") = void setup() { //Serial.begin(9600); + Serial.begin(31250); pinMode(ENC_BTN_PIN, INPUT_PULLUP); pinMode(START_STOP_BTN_PIN, INPUT_PULLUP); @@ -213,6 +213,10 @@ void loop() { checkInputs(); } +void sendMIDIClock() { + Serial.write(0xF8); +} + void clock() { if (isPlaying) { @@ -220,6 +224,7 @@ void clock() { if (tickCount == 0) { sendTriggers(); digitalWrite(clockOutPin, HIGH); + sendMIDIClock(); } //this part gets the Pulse and Ticks ticking