questions about "add file" to sketch


i experimenting on rather large sketch , have noticed making corrections starting take longer scroll find "area in sketch" problem in takes me debug. wish had funding multiple computer screens display different parts of code, right isn't option.

i curious how add file works, , if can use drastically cut downtime finding i'm looking for.


 i posted 2 simple parts of code below use explain questions below

code part 1
code: [select]
int button = 2
boolean rememberbutton = 0;


void setup() {
  // put setup code here, run once:
pinmode(button,input);
serial.begin(9600);
}

void loop() {
  // put main code here, run repeatedly:
  if (button == high)
  {
    rememberbutton = high;
  }
}


code part2

code: [select]
int led1 = 3;


void setup() {
  // put setup code here, run once:
pinmode(led1,output);
serial.begin(9600);
}

void loop() {
  // put main code here, run repeatedly:
  if (rememberbutton == high)
  {
    led1 = high;
  }
}


now questions are:
1. work? i'm not sure if (what section above void setup called?) if adding file if (sections) transfer next file automatically? ex. button claimed in code part1 not in code part2.

2. make sketch larger if put of in 1 sketch without separate files?

3. slow down sketch when has switch between files?

4. can go 1 file next without completing entire sketch. similar how can put name(); function in void loop, when sees goes directly void name(){} part, completes that, goes left off.

5. because both code parts have void setup() , void loop() have make master sketch
quote
that has void setup()
{
void codepart1setup();
void codepart2setup();
}

void loop(){
void codepart1loop();
void codepart2loop();
}
and change void setup() in both of add file parts codepart_setup();? or work leaving void setup() void loop() places are?

============edit======================
what calling (file) meant (tab) didn't know proper name it

i use tabs shorten pages scrolling - click arrow @ top right of ide. i'll use 7 or - original file name, a_presetup, b_setup, c_void, d_morevoid, e_functions, etc.
in original i'll have notes, rest names describe.


Arduino Forum > Using Arduino > Programming Questions > questions about "add file" to sketch


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code