Reeduino question

My favourite
Post Reply
jmendoza
Posts: 167
Joined: 18 Feb 2018, 23:07

Reeduino question

Post by jmendoza »

// const bool activetoggles[] = {1,1,0,1,0,0}; // Tiny6ch.
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

OK how do I select the 10 channel above? I see no place in the sketch where you have a place to enter the ones and zeros for the toggles you plan to use. I see above the examples in the sketch, but since all three are there, how do I define which one i want to use in the sketch?

Thanks,
Jay
User avatar
Phil_G
Posts: 597
Joined: 15 Feb 2018, 23:32
Contact:

Re: Reeduino question

Post by Phil_G »

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.
GarydNB
Posts: 282
Joined: 15 Feb 2018, 23:12

Re: Reeduino question

Post by GarydNB »

Aahhhhh, right, now I get it...... :shock:
jmendoza
Posts: 167
Joined: 18 Feb 2018, 23:07

Re: Reeduino question

Post by jmendoza »

Thanks Phil
to confirm, simply delete the // ahead of the configuration desired to activate it.

Does the "const bool" turn blue when the // ahead of it are removed?

That was not clear to me in the initial information on the Reeduino. I guess for guys intimately familiar with sketches it is a given and not worth mentioning.

To really be up to speed on this stuff requires a lot of study and learning. Thank God I have you guys here to guide me through as this and answer questions that seem obvious, but are not.



Thanks again, Happy Holidays, you are the best!!!! ;)
jmendoza
Posts: 167
Joined: 18 Feb 2018, 23:07

Re: Reeduino question

Post by jmendoza »

Thanks Phil,

I though the blue script was a clue as to which statement was active, but seeing as I'm not familiar with how to write sketches, I have to guess and make assumptions, which is never any good to do.

Your patience and attention to my issues is very much appreciated.
What would we all do without you Phil????

Getting ready to program the Mini-Strong for the Orbit 10. It's an old bird circa 1959, all tube, huge case.


Cheers,
Jay
Post Reply