Sketch not running in a loop

Hi,

I am very new to Arduino and I try to let something run with Lego Powerfunctions.

Currently I have two questions:

  1. Can I run a sketch only once and not in a loop? If yes, how can I do that?

  2. Can I run different Sketches by PC with PHP?
    I want PHP to controll the Arduino and tell it which Sketch to run when.

Thanks for your help

kay899

  1. How can I do that???

There are examples how to merge sketches. Do a search.

It will not always be possible due to interrupt conflicts, running out of pins or memory and whatever other problems can occur.