pinToggle library - comments please

UKHeliBob:
I am not going to get bogged down in the semantics.

classes are largely semantic in nature as @PaulS comments point out. The member names may have tons of meaning to you when you write it, but look back on it in three months time and you will be scratching your head, thinking: "Who the heck wrote this"? It happens to everyone.

pinToggle::init(byte pin)

I like:

pinToggle::bindToPin(byte pin)

very explicit...

i agree with the previous post, your use of the array for timing periods is a bit wonky.

Interesting choice, not explicitly writing the return types of the functions:

  public:
    pinToggle();  //constructor
    init(byte pin); //set pinMode
    startToggling(byte state, unsigned long lowPeriod, unsigned long highPeriod, unsigned int toggleCount = 0);  //set initial state and periods
    restartToggling(); //restart toggling with original parameters
    update();  //check whether period has ended and change state if true
    setOutputState(byte state); //set the output state for the pin and stop toggling
    getOutputState(); //get the current state of the output
    stopToggling(byte state); //stop toggling and go into the given state
    resumeToggling(); //resume toggling
    getTogglingState(); //get toggling state
   getToggleCount(); //get the number of toggles remaining

UKHeliBob:
Any more suggestions before I finalise version 1 and post it here.

How about a callback function when the pin toggling is completed?

I understand that this is a learning exercise for you, you'll probably never use the class in any real application, but getting comments is extremely useful. Classes are written to make coding easier so getting opinions from colleagues will definitely help you class 'em up. Cheers to you for doing that....