Another Question - Accessing Varibles Dynamically
hi once again,
i have been thinking of ways optimize code writing ensure not go on 32kb limitation, example, have 6 outputs (using analog pins) in software name out1,out2.... , these assigned values when activated 0 if not @ all, 1 if straight away , 2 if 1s later. actual activation going use direct port manipulation hence need join group of 6 0s , 1s , 2s 2 commands, first activation , second activation. know how sort values based on whether 1s or 2s quite easily.
hence 2 questions there way can access value e.g. lcd.print(out & 1) value of out1? second question similar different solution there way create string or number based on values of out1 2 etc e.g. = out1 & out2 & out3
so if out1 0, out2 2 , out3 1, equal 023, or write each value char array read whole?
thanks in advance
callum phenix
i have been thinking of ways optimize code writing ensure not go on 32kb limitation, example, have 6 outputs (using analog pins) in software name out1,out2.... , these assigned values when activated 0 if not @ all, 1 if straight away , 2 if 1s later. actual activation going use direct port manipulation hence need join group of 6 0s , 1s , 2s 2 commands, first activation , second activation. know how sort values based on whether 1s or 2s quite easily.
hence 2 questions there way can access value e.g. lcd.print(out & 1) value of out1? second question similar different solution there way create string or number based on values of out1 2 etc e.g. = out1 & out2 & out3
so if out1 0, out2 2 , out3 1, equal 023, or write each value char array read whole?
thanks in advance
callum phenix
strings slow, imho, careful:
code: [select]
int int1=1;
int int2=2;
int int3=3;
string mystring = "";
mystring += int1;
mystring += int2;
mystring += int3;
serial.println(mystring); //prints 123
Arduino Forum > Using Arduino > Programming Questions > Another Question - Accessing Varibles Dynamically
arduino
Comments
Post a Comment