boxxofrobots
Well-known member
The following snippet of code is from a supposedly working arduino sketch to generate a euclidian pattern. However, even when I try to compile the original, full sketch I get this same error, which I do not understand. Can someone help explain this please?
Thanks
Thanks
Code:
void setup() {
// put your setup code here, to run once:
}
int channel = 0;
int remainder[16];
int count[16];
int level;
int state = 0;
int stateArray[6][16];
int beat[6] = {0, 0, 0, 0, 0, 0};
void compute_bitmap(int num_slots, int num_pulses, int channel) {
int steps, pulses;
if (num_pulses > num_slots) {
num_pulses = num_slots;
}
int divisor = num_slots - num_pulses;
steps = num_slots; pulses = num_pulses;
remainder[0] = num_pulses;
level = 0;
do {
count[level] = divisor / remainder[level];
remainder[level + 1] = divisor % remainder[level];
divisor = remainder[level];
level = level + 1;
}
while (remainder[level] > 1);
count[level] = divisor;
build_string (level, channel);
}
//Bjorklund accessory function to build the output..
void build_string (int level, int channel) {
if (level == -1) {
Serial.println('0'); // Debug
stateArray[channel][state] = 0; //insert 0 into array
state = state + 1; //move to next
}
else if (level == -2) {
Serial.println('1'); // Debug
stateArray[channel][state] = 1; //insert 1 into array
state = state + 1; //move to next
}
else {
for (int i = 0; i < count[level]; i++)
build_string(level - 1, channel);
if (remainder[level] != 0)
build_string(level - 2, channel);
}
}
void loop() {
// put your main code here, to run repeatedly:
}