-3

please help. I have old code for making analog synth and cant compile it on teensy 2.0, I use Arduino 1.6.9 and teensyduino 1.29 Full code with errors

Error log: invalid conversion from 'void ()(uint8_t, unsigned int) {aka void ()(unsigned char, unsigned int)}' to 'void ()(uint8_t, int) {aka void ()(unsigned char, int)}' [-fpermissive]

Mistake here, when use function: doBend;

void doBend(byte channel, unsigned int bend_usb) {
    byte chip_select = channel / 4; 
    channel = channel % 4;
    bendMSB = bend_usb >> 7; 
    bendLSB = bend_usb % B01111111; 
    if(channel >=0 && channel <= 2) {
       bend_MSB[channel + (chip_select * 4)] = bendMSB;
       bend_data[channel + (chip_select * 4)] = bend_MSB[channel + (chip_select * 4)];
       writeFrequency(pitchData[channel + (chip_select * 4)], channel, chip_select);
    }
}

Arduino don't know "unsigned int bend_usb". I dont know c++ and need your help, how to fix this bug!

stress_tn
  • 174
  • 3
  • 12

1 Answers1

-1

The issue is probably related to this expression: usbMIDI.setHandlePitchChange(doBend);

In this expression doBend behaves as a pointer to a function. Could you check the type of the parameter of the setHandlePitchChange function?

smateo
  • 177
  • 5