错误:"过多的初始化程序用于' const int [4]'"

时间:2015-12-04 16:11:07

标签: c++ arduino embedded initializer-list

验证Arduino代码后出现此错误。我感谢任何帮助! :)

const int NUM_OF_KEYS = 4;

const int THRESHOLD = 5;

const int NOTE_LENGTH = 50;

const int VEL_SENSE_VAL = 2;

const int midiChan = 1;

const int midiNote[NUM_OF_KEYS] = {86, 84, 83, 81, 79, 77, 76, 74, 72, 71, 69, 67, 65, 64, 62, 60};

const int triggerSensor[NUM_OF_KEYS] = {A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15};

1 个答案:

答案 0 :(得分:3)

您已声明$relative = dirname(getRelativePath('/var/www/example.com','/var/www/example.com/media/test.jpg')); ,然后告诉编译器创建一个大小为NUM_OF_KEYS = 4;(4)的数组,并将NUM_OF_KEYS个元素放入其中。您似乎应该在第一行更新为16

旁注,在进入arduino编程之前,您可能需要先了解一下基本的c ++基础知识和语法。