right code for arduino mega 2560, midi mapping in DAW is fluctuating


i trying make midi controller 16 potentiometers, push buttons , sensors arduino mega 2560. have been able use usb midi dont need 5 pin din io. have spent days , night looking right codes arduino mega 2560 use potentiometers, buttons, multiplexer , sensors have got no clue far. kinda frustrated. got code uno , site says have done direct port manipulation uno specially , dont know how change codeforunotto mega 2560 or should do. still if upload code have lot of fluctuations problems due when try map knob in daw, automatically takes values without me touching controller , keeps changing. looking , hope guys expertise can me out. appreciate if send me link code supports mega 2560 , notes on how manipulate basic codes per required numbers of buttons , controllers. thank .

quote
i have spent days , night looking right codes arduino mega 2560 use potentiometers, buttons, multiplexer , sensors have got no clue far.
your time have been better spent learning write code.


quote
i dont know how change codeforunotto mega 2560
see:-
direct port mapping

quote
it automatically takes values without me touching controller , keeps changing.
probably because poor code. analogue reading fluctuate small amount. code needs remember last number got when sent last midi message pot, , send new message when pot reading different amount, put amount variable called threshold.
so code fragment like:-
code: [select]

if(abs(analogread(pin) - lastreadingforthispin) > threshold ) {
   // send value given new pot reading
}


Arduino Forum > Using Arduino > Audio > right code for arduino mega 2560, midi mapping in DAW is fluctuating


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'