I'm looking for a point in the right direction on whats needed to set an arduino board, power it, but not start running the code until it receives an input?
i.e. power everything, then send a '#' by rf through serial and the loop starts running, and the code starts to run doing all the things i want it do.
I imagine its in the void setup() section, but i'm just not sure what functions i should be looking for, or even what this is called to find previous examples/previous questions about it.
Well if receiving a specific character is the 'trigger' to start the rest of the sketch, then yes, just use the serial commands (Serial.avalible) in your setup function to wait for a character to be received and then read the character and test if it's the correct character, and if so, fall through to the loop() function.
Here is a simple part of one of my sketches where I wait for a character to be sent and then drop on to the reset of the code:
while(Serial.available() < 1) { } // wait for user keystroke
while(Serial.available() > 0) {byte userKeys = Serial.read();} //read keystrokes
Since loop() doesn't run until setup() is finished, all you have to do is delay the end of setup().
setup()
{
Serial.begin(9600);
// Other setup instructions
// Don't go on to loop() until we receive a '#'.
while (Serial.read() != '#')
; // Do nothing
}
void loop()
{
// Your code here
}