the all thing is working !

This commit is contained in:
2024-06-20 18:08:27 +02:00
parent fbc4292c0a
commit a9db88e9b6
3 changed files with 160 additions and 58 deletions

34
midi/midi.ino Normal file
View File

@@ -0,0 +1,34 @@
#include "MIDIUSB.h"
#define NUM_BUTTONS 7
// https://github.com/arduino/tutorials/blob/master/ArduinoZeroMidi/PitchToNote.h
uint8_t intensity = 127;
void setup(){
}
void loop(){
noteOn(0, 95, intensity);
MidiUSB.flush();
delay(1000);
noteOff(0, 95, 0);
MidiUSB.flush();
delay(1000);
}
void noteOn(byte channel, byte pitch, byte velocity) {
midiEventPacket_t noteOn = {0x09, 0x90 | channel, pitch, velocity};
MidiUSB.sendMIDI(noteOn);
}
void noteOff(byte channel, byte pitch, byte velocity) {
midiEventPacket_t noteOff = {0x08, 0x80 | channel, pitch, velocity};
MidiUSB.sendMIDI(noteOff);
}