quel ligne de codes pourrai rendre plus restrictif ?
es ce qu'un code de ce style serai plus approprié ?
#include <MIDI.h>
const int channel = 1;
int analogValue = 0;
int previousMIDI = 0;
int newMIDI = 0;
void setup(){
}
void loop(){
analogValue = analogRead(A0);
if (analogValue % 8 == 0 && analogValue / 8 != previousMIDI){
newMIDI = analogValue / 8;
usbMIDI.sendControlChange(20, newMIDI, channel);
previousMIDI = newMIDI;
}
}/code]