I haven't compiled this but I believe it will work.
A few things to notice:
I moved the code that controls the stepper to a trigger, this way it only runs when it needs to.
I removed the "delay" calls in your code, those are very bad in Embrio. Instead I moved the logic controlling when the stepper should run to a switch and timer, which toggles turning the motor one way and the other ever second.
The reason delay calls are bad is like I said, each node reserves the amount of time it will take to run on a time line. If the code is quick, then your nodes will all execute X times per second, the refresh rate is set on the bottom right of an agent screen. If your node has 2 delays of half a second each, then every time the node executes the whole program will wait for 1 second, so instead of all of your nodes executing say 32 times per second, they will only execute once per second. Eventually I'll add a tool to visualize the compiled timeline and some warnings and errors.
In what I have below, your program will run smoothly UNTIL the trigger is fired, then the whole program will pause while the "myStepper.step(steps);" line completes. Depending on what else is happening in your program this may or may not be a problem.
<EmbrioCopy>
<Version>1.3.6.0</Version>
<Nodes>
<Node>
<UniqueID>b2374b34-dea5-41e7-b97d-3bfbd55d9c0e</UniqueID>
<AssemblyType>Embrio.NodeEngine.AgentController.Nodes.DynamicNode</AssemblyType>
<NodeType>Startup Trigger</NodeType>
<UserDefinedName></UserDefinedName>
<Description></Description>
<NodeColor>229,229,197,255</NodeColor>
<X>0</X>
<Y>0</Y>
<Width>260</Width>
<DefinitionID>c9315389-c2e7-4f40-bcfe-8a678ef89373</DefinitionID>
<Inputs></Inputs>
<Outputs>
<Output>
<UniqueID>42c5c860-33ee-4670-a0c2-0ee1fc514dbc</UniqueID>
<DefinitionID>9533a00b-d9fd-472e-a2d9-739a7be82c2e</DefinitionID>
<DefaultName>Trigger</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
</Output>
</Outputs>
</Node>
<Node>
<UniqueID>d95fa385-7010-4264-8894-6f0537b895b1</UniqueID>
<AssemblyType>Embrio.Nodes.FlowControl.TimerNode</AssemblyType>
<NodeType>Timer</NodeType>
<UserDefinedName></UserDefinedName>
<Description>An output activation changes based on a timer. The maximum number of seconds can be changed on the node, and the duration input scales the actual time used. Triggers fire when the timer is started, stopped, finished, and restarted.</Description>
<NodeColor>229,229,197,255</NodeColor>
<X>309.866666666666</X>
<Y>24.0666666666668</Y>
<Width>260</Width>
<EndBehavior>MinValue</EndBehavior>
<MaxTimeSeconds>1</MaxTimeSeconds>
<Inputs>
<Input>
<UniqueID>9bcb6d40-612d-4d3e-85ae-358df44558df</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Start</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>True</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
<ConnectedOutputs>
<Output>61556964-562b-41b9-b227-0eb4fde8956a</Output>
<Output>42c5c860-33ee-4670-a0c2-0ee1fc514dbc</Output>
</ConnectedOutputs>
</Input>
<Input>
<UniqueID>e955dfad-2275-4a82-8052-6b5065dab05f</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Stop</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>True</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
<ConnectedOutputs></ConnectedOutputs>
</Input>
<Input>
<UniqueID>f17edae0-9065-422b-a022-7da21b19dc4b</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Restart</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>True</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
<ConnectedOutputs></ConnectedOutputs>
</Input>
<Input>
<UniqueID>c73c2de9-a20d-4928-a8b9-2b46afec8be9</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Duration</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>True</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
<ConnectedOutputs></ConnectedOutputs>
<BlendMode>Add</BlendMode>
<DisconnectedValue>1</DisconnectedValue>
<UseNegativeRange>False</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Input>
</Inputs>
<Outputs>
<Output>
<UniqueID>d6c30743-c152-449b-ab3a-b0284f81a04f</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Started</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>True</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
</Output>
<Output>
<UniqueID>61556964-562b-41b9-b227-0eb4fde8956a</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Finished</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>True</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
</Output>
<Output>
<UniqueID>282c617d-1e62-4e47-aa10-38db287fcb33</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Stopped</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>True</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
</Output>
<Output>
<UniqueID>b9783c6e-89dd-40d6-9b03-00b3bccc86bd</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Restarted</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>True</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
</Output>
<Output>
<UniqueID>cfaedce9-7909-414e-881d-37564fa299f3</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Output</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>True</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
<MinValue>0</MinValue>
<MaxValue>1</MaxValue>
<UseNegativeRange>False</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Output>
</Outputs>
</Node>
<Node>
<UniqueID>17c28013-ae72-445f-9757-0e0981c91b11</UniqueID>
<AssemblyType>Embrio.NodeEngine.AgentController.Nodes.DynamicNode</AssemblyType>
<NodeType>Switch</NodeType>
<UserDefinedName></UserDefinedName>
<Description></Description>
<NodeColor>229,229,197,255</NodeColor>
<X>613.2</X>
<Y>14.0666666666668</Y>
<Width>260</Width>
<DefinitionID>13030c99-98ce-4f5b-bdc5-5ee155eac37c</DefinitionID>
<Inputs>
<Input>
<UniqueID>8fabaa97-8de5-45da-b904-428c1f5c6bf8</UniqueID>
<DefinitionID>a8114d67-28ba-43a7-b292-5065f966dde3</DefinitionID>
<DefaultName>On Value</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
<ConnectedOutputs></ConnectedOutputs>
<BlendMode>Add</BlendMode>
<DisconnectedValue>1</DisconnectedValue>
<UseNegativeRange>False</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Input>
<Input>
<UniqueID>85ccc143-5c28-48d8-aecd-f2d49a08bffd</UniqueID>
<DefinitionID>88d36748-1367-442a-997a-1055f1fe32f4</DefinitionID>
<DefaultName>Off Value</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
<ConnectedOutputs></ConnectedOutputs>
<BlendMode>Add</BlendMode>
<DisconnectedValue>-1</DisconnectedValue>
<UseNegativeRange>True</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Input>
<Input>
<UniqueID>04e6abb2-9aab-483b-997b-a7adeeeb3f99</UniqueID>
<DefinitionID>b53a92f7-c2ee-4c85-a58b-3bbc75dafae0</DefinitionID>
<DefaultName>Turn On</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
<ConnectedOutputs></ConnectedOutputs>
</Input>
<Input>
<UniqueID>786ca777-5378-408d-8ea5-efe0cf528329</UniqueID>
<DefinitionID>f892a324-2a05-4132-bbe1-e4038aad4f0f</DefinitionID>
<DefaultName>Turn Off</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
<ConnectedOutputs></ConnectedOutputs>
</Input>
<Input>
<UniqueID>ddf1c563-8508-49b8-8906-c0e20e620893</UniqueID>
<DefinitionID>e6265564-36b2-4ca6-8da9-4516345f3a7e</DefinitionID>
<DefaultName>Toggle</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
<ConnectedOutputs>
<Output>61556964-562b-41b9-b227-0eb4fde8956a</Output>
</ConnectedOutputs>
</Input>
</Inputs>
<Outputs>
<Output>
<UniqueID>7d1f07bb-b94f-4149-9fcc-40f95bed6c9d</UniqueID>
<DefinitionID>5298cec5-3257-4ea1-9ed0-0f06b7be1293</DefinitionID>
<DefaultName>Activation</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
<MinValue>-1</MinValue>
<MaxValue>1</MaxValue>
<UseNegativeRange>True</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Output>
<Output>
<UniqueID>601a1d68-6a9d-4f73-9b43-51500c3253bc</UniqueID>
<DefinitionID>a20f60f2-2608-48db-92cf-90be81dcb5b6</DefinitionID>
<DefaultName>Turned On</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
</Output>
<Output>
<UniqueID>23523732-d5dd-4715-ab8e-e9a9e17f7073</UniqueID>
<DefinitionID>c67e21ce-6ec8-4048-9973-3cedb4ee8927</DefinitionID>
<DefaultName>Turned Off</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
</Output>
<Output>
<UniqueID>461df032-0905-406e-98dd-1cf46b29bbcb</UniqueID>
<DefinitionID>52f1e9c7-efa8-48db-8a10-7dd671aa74ae</DefinitionID>
<DefaultName>Toggled</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>False</IsUserAdded>
</Output>
</Outputs>
</Node>
<Node>
<UniqueID>d6e9c885-f33a-455c-9c13-d15491df3005</UniqueID>
<AssemblyType>Embrio.NodeEngine.AgentController.Nodes.AgentControllerCustomArduinoNode</AssemblyType>
<NodeType>Custom Arduino Node</NodeType>
<UserDefinedName></UserDefinedName>
<Description>A node that lets you write any Arduino code to interact with the Arduino hardware. Can be both an input and output.</Description>
<NodeColor>144,183,227,255</NodeColor>
<X>923.2</X>
<Y>67.4000000000001</Y>
<Width>749</Width>
<IncludeCode>#include <Stepper.h></IncludeCode>
<DeclerationCode>int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);</DeclerationCode>
<SetupCode> // set the speed at 60 rpm:
myStepper.setSpeed(60);
</SetupCode>
<ImageName>arduino.png</ImageName>
<InfoURL></InfoURL>
<IsOpen>True</IsOpen>
<EditWidth>360</EditWidth>
<CodeDefinitions>
<CodeDefinition>
<TriggerInputID>e214aee2-d6ee-4b63-9b26-c78a2019580e</TriggerInputID>
<UpdateCondition>Trigger</UpdateCondition>
<Code>int steps = transform(Input_Steps, 0.0, 1.0, 200, 1000);
if (Input_Direction &lt; 0)
{
steps = steps * -1;
}
myStepper.step(steps);</Code>
<UniqueID>2750eadb-0192-4fab-b757-22d43ef0437f</UniqueID>
</CodeDefinition>
</CodeDefinitions>
<Inputs>
<Input>
<UniqueID>db946d50-b9dd-4e4d-bb43-c2ff4ed1dd56</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Activation 1</DefaultName>
<CustomName>Steps</CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<ConnectedOutputs></ConnectedOutputs>
<BlendMode>Add</BlendMode>
<DisconnectedValue>0.27</DisconnectedValue>
<UseNegativeRange>False</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Input>
<Input>
<UniqueID>9ed30dcc-3cfe-472e-833f-63899ad0b426</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Activation</DefaultName>
<CustomName>Direction</CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<ConnectedOutputs>
<Output>7d1f07bb-b94f-4149-9fcc-40f95bed6c9d</Output>
</ConnectedOutputs>
<BlendMode>Add</BlendMode>
<DisconnectedValue>0</DisconnectedValue>
<UseNegativeRange>True</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Input>
<Input>
<UniqueID>e214aee2-d6ee-4b63-9b26-c78a2019580e</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Trigger</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Trigger</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.TriggerNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<ConnectedOutputs>
<Output>461df032-0905-406e-98dd-1cf46b29bbcb</Output>
</ConnectedOutputs>
</Input>
</Inputs>
<Outputs></Outputs>
</Node>
</Nodes>
</EmbrioCopy>