This is a very basic AND very important question. Most computer programs have a start and an end. Almost all microcontroller programs should never quit. So the idea is to loop forever. There are several ways to do this. Atmel (the maker of the chip on the Axon) recommends the following
main{
// set up functions
for(;;){
// loop forever
}
Of course the while loop works fine. It just takes a tiny bit more memory.
Kirk
PS.
to understand the test structures of C, you should get a good C book. I like the book C by example. Also the Arduino web site has good references on all the control structures of C (but often some bad practices in the examples)
while will continue until the test in () evaluates to zero. Zero is considered false. anything else is considered true.
The following all do the same thing
char a = 1;
while (a != 0) {
// do stuff the long way
}
char a = 1;
while (a) {
// do stuff but still waste some RAM
}
while (1) {
// do stuff
}