Power on

How to set code so that it only runs the cylce once per turning on.

Depending where you want this operation to occur, it can either go in set up, or if it needs to be somewhere in the loop you can use an if statement to test a boolean variable, initialized as false, to see if the operation has been executed,

if (beenThereDoneThat ==false)
{
//execute the one time code
beenThereDoneThat = true;
}

Just put it in

void setup(){

}

void loop(){

}