Method to modify part of a statement?
hello,
thanks reading. questions programming difficult when you're not sure you're using correct terminology here goes.
i'm curious if there method of modifying portion of statement (correct terminology?) argument function.
for example:
take function - readpotentiometers();
add argument - readpotentiometers(int a);
inside function (see comments):
i argument modify line:
if ((prev(a) + 20) < || (prev(a) - 20) > a)
to read when compiled:
if ((preva + 20) < || (preva - 20) > a)
is that's possible? i've ran few cases convenient tool.
thanks reading. questions programming difficult when you're not sure you're using correct terminology here goes.
i'm curious if there method of modifying portion of statement (correct terminology?) argument function.
for example:
take function - readpotentiometers();
add argument - readpotentiometers(int a);
inside function (see comments):
code: [select]
void readpotentiometers(int a)
{
= analogread(pota);
= constrain(a, 40, 980);
// serial << red << endl;
if ((prev(a) + 20) < || (prev(a) - 20) > a) // here add argument (a) end of "prev" result of preva
{
prev(a) = a; // here also.
= map(a, 40, 980, 0, 255);
serial << "new value: " << << endl;
wire.begintransmission(9); // transmit device #9
wire.write(5);
wire.write(a);
wire.endtransmission();
}
i argument modify line:
if ((prev(a) + 20) < || (prev(a) - 20) > a)
to read when compiled:
if ((preva + 20) < || (preva - 20) > a)
is that's possible? i've ran few cases convenient tool.
no names ect gone run time.
mark
mark
Arduino Forum > Using Arduino > Programming Questions > Method to modify part of a statement?
arduino
Comments
Post a Comment