While with a variable for C
johnproko
Posts: 121
Hi all.
I would like to ask if I can use the while function in the while(1) with a variable a push button.
For example
while(1)
{
op = input(16);
while( op == 1)
{
calculations
op = input(16);
}
}
something like the DO UNTIL... LOOP for the BS2.
Thank you
I would like to ask if I can use the while function in the while(1) with a variable a push button.
For example
while(1)
{
op = input(16);
while( op == 1)
{
calculations
op = input(16);
}
}
something like the DO UNTIL... LOOP for the BS2.
Thank you
Comments
yes that would be perfect. There's also the lesser known "do-while".
--Edit--
Fixed my bad code
while(input(16)) { ... }
And then there is the do, while
incase you want it done at least one time.
Disassembly is great to use to see if the compilers assembler is doing what you want.