Hi Jay
The two forward-slashes tell the compiler that the rest of the line is just a comment, to be ignored.
Comments are for our benefit, just to explain things, they dont affect the program at all.
If you have two config lines, only one of which you want 'active' its usual to have both lines in the code but to 'comment out' the unwanted line. This means its still there for the readers comprehension but the compiler ignores it, as its a comment.
In this format its exactly like REM in BASIC. There is also an option for commenting blocks of text rather than individual lines.
So in this case, all the activetoggles configurations are 'commented out' by prefixing with '//', except the one you actually want. Remember to
add the '//' to any unwanted active line thats presently un-commented... there should only ever be one uncommented activetoggles line.
This is a 12 channel configuration:
Code: Select all
// Configuration section:
// indicate which toggles are wired up, 0 for no, 1 for yes in the order: aileron, elevator, rudder, throttle, aux, trim
// two examples: ail,ele,rud,thr,trim for a 10ch reed tx, activetoggles[] = {1,1,1,1,0,1,};
// ail,ele,throttle for a 6ch reed transmitter using the Tiny6 trim button, activetoggles[] = {1,1,0,1,0,0};
// const bool activetoggles[] = {1,1,0,1,0,0}; // Tiny6ch.
// const bool activetoggles[] = {1,1,1,1,0,0}; // 8ch, with trim button but no trim toggle
// const bool activetoggles[] = {1,1,1,1,0,1}; // 10ch. 1 for the toggles you are using, 0 for unused ones,
const bool activetoggles[] = {1,1,1,1,1,1}; // 12ch. this prevents unwired ones reading randomly
...and this is a 10 channel configuration:
Code: Select all
// Configuration section:
// indicate which toggles are wired up, 0 for no, 1 for yes in the order: aileron, elevator, rudder, throttle, aux, trim
// two examples: ail,ele,rud,thr,trim for a 10ch reed tx, activetoggles[] = {1,1,1,1,0,1,};
// ail,ele,throttle for a 6ch reed transmitter using the Tiny6 trim button, activetoggles[] = {1,1,0,1,0,0};
// const bool activetoggles[] = {1,1,0,1,0,0}; // Tiny6ch.
// const bool activetoggles[] = {1,1,1,1,0,0}; // 8ch, with trim button but no trim toggle
const bool activetoggles[] = {1,1,1,1,0,1}; // 10ch. 1 for the toggles you are using, 0 for unused ones,
// const bool activetoggles[] = {1,1,1,1,1,1}; // 12ch. this prevents unwired ones reading randomly
...this is a 6 channel config, like the Tiny-6:
Code: Select all
// Configuration section:
// indicate which toggles are wired up, 0 for no, 1 for yes in the order: aileron, elevator, rudder, throttle, aux, trim
// two examples: ail,ele,rud,thr,trim for a 10ch reed tx, activetoggles[] = {1,1,1,1,0,1,};
// ail,ele,throttle for a 6ch reed transmitter using the Tiny6 trim button, activetoggles[] = {1,1,0,1,0,0};
const bool activetoggles[] = {1,1,0,1,0,0}; // Tiny6ch.
// const bool activetoggles[] = {1,1,1,1,0,0}; // 8ch, with trim button but no trim toggle
// const bool activetoggles[] = {1,1,1,1,0,1}; // 10ch. 1 for the toggles you are using, 0 for unused ones,
// const bool activetoggles[] = {1,1,1,1,1,1}; // 12ch. this prevents unwired ones reading randomly
Note that in each case, the line we want has had its '//' prefix removed, and all the lines we dont want are commented out by the '//' prefix.