New State machine tutorial

nielyay:

enum LedStates{ON, OFF};

*what is [enum] function?

It is not a function, more like a variable, it tells the compiler to associate labels with numbers under a certain name.

enum unoSpi { mosi=11, miso, sck }; // mosi starts as 11, miso is 12, sck is 13

enum rgbColor { red=1, green, blue }; // starts at 1

enum smallNumbers { zero, one, two, three }; // zero is by default 0, one is 1, etc

When I have a function that has an unoSpi arg, the compiler will only accept unoSpi values in that place.