请帮忙。我有用于制作模拟合成器的旧代码,并且无法在teensy 2.0上编译它,我使用Arduino 1.6.9和teensyduino 1.29 Full code with errors
错误日志:从'void()(uint8_t,unsigned int){aka void()(unsigned char,unsigned int)}'到'void()(uint8_t)无效转换,int){aka void()(unsigned char,int)}'[-fpermissive]
错误在这里,当使用函数: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不知道“unsigned int bend_usb”。 我不懂c ++并需要你的帮助,如何修复这个bug!
答案 0 :(得分:-1)
问题可能与此表达式有关:
usbMIDI.setHandlePitchChange(doBend);
在此表达式中,doBend
表现为指向函数的指针。你能检查一下setHandlePitchChange
函数的参数类型吗?