Please see my last post here: http://forum.arduino.cc/index.php?topic=411069.0 When declaring a function after loop() it works but in this case (providing an init value in my script) it doesn't (not declared in this scope).