emmanuel63
Well-known member
Hello,
This is probably a stupid question, but I don't know how to declare multiple objects. There must be a way to do this, but I don't know how.
For instance, I have a MIDI controller with 24 pots. I use the ResponsiveAnalogRead library to smooth the noise. Then I make an array to handle my pots in my sketch. Here is the way I do it :
There must be another way to declare all my pots...
Thanks for your help
Emmanuel
This is probably a stupid question, but I don't know how to declare multiple objects. There must be a way to do this, but I don't know how.
For instance, I have a MIDI controller with 24 pots. I use the ResponsiveAnalogRead library to smooth the noise. Then I make an array to handle my pots in my sketch. Here is the way I do it :
Code:
ResponsiveAnalogRead pot0(38, true);
ResponsiveAnalogRead pot1(38, true);
ResponsiveAnalogRead pot2(38, true);
ResponsiveAnalogRead pot3(38, true);
ResponsiveAnalogRead pot4(38, true);
ResponsiveAnalogRead pot5(38, true);
ResponsiveAnalogRead pot6(38, true);
ResponsiveAnalogRead pot7(38, true);
ResponsiveAnalogRead pot8(38, true);
ResponsiveAnalogRead pot9(38, true);
ResponsiveAnalogRead pot10(38, true);
ResponsiveAnalogRead pot11(38, true);
ResponsiveAnalogRead pot12(38, true);
ResponsiveAnalogRead pot13(38, true);
ResponsiveAnalogRead pot14(38, true);
ResponsiveAnalogRead pot15(38, true);
ResponsiveAnalogRead pot16(39, true);
ResponsiveAnalogRead pot17(39, true);
ResponsiveAnalogRead pot18(39, true);
ResponsiveAnalogRead pot19(39, true);
ResponsiveAnalogRead pot20(39, true);
ResponsiveAnalogRead pot21(39, true);
ResponsiveAnalogRead pot22(39, true);
ResponsiveAnalogRead pot23(39, true);
ResponsiveAnalogRead pot24(39, true);
ResponsiveAnalogRead pot25(39, true);
ResponsiveAnalogRead pot26(39, true);
ResponsiveAnalogRead pot27(39, true);
ResponsiveAnalogRead pot28(39, true);
ResponsiveAnalogRead pot29(39, true);
ResponsiveAnalogRead pot30(39, true);
ResponsiveAnalogRead pot31(39, true);
ResponsiveAnalogRead *pot[] = {&pot0, &pot1, &pot2, &pot3, &pot4, &pot5, &pot6, &pot7, &pot8, &pot9, &pot10, &pot11, &pot12, &pot13, &pot14, &pot15,
&pot16, &pot17, &pot18, &pot19, &pot20, &pot21, &pot22, &pot23, &pot24, &pot25, &pot26, &pot27, &pot28, &pot29, &pot30, &pot31
};
There must be another way to declare all my pots...
Thanks for your help
Emmanuel