system
1
void SENSE(byte _rPin_1st, byte _rPins) {
for (int _rPin = _rPin_1st; _rPin < _rPins; _rPin++) {
CapSense_now[_rPin] = cs_rPin[_rPin].capSense(capSamples);
}
}
Can the above be simplified as follows?
void SENSE(byte _rPin, byte _rPins) {
for (_rPin; _rPin < _rPins; _rPin++) {
CapSense_now[_rPin] = cs_rPin[_rPin].capSense(capSamples);
}
}
system
2
If there is nothing to do in the initialization section, it can be left blank:
for (; _rPin < _rPins; _rPin++)
The same holds true for any other section. The ;s are still required.
MarkT
3
Each of the three parts in a for statement separated by semicolons are optional - the semicolons are required though. For instance you can say
for (;;)
{
}
for an infinite loop! Though it might be more readable to say
for (;true;)
{
}