Rank: Member
Groups: BetaUser, Registered Joined: 2/7/2015(UTC) Posts: 17
Thanks: 4 times
|
Here is simple node for temperature sensor LM35 Code:
<Nodes>
<Node>
<UniqueID>f3af9ab1-3469-4743-bbc6-7850ee9add72</UniqueID>
<AssemblyType>Embrio.NodeEngine.AgentController.Nodes.AgentControllerCustomArduinoNode</AssemblyType>
<NodeType>LM35</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>201,204,227,255</NodeColor>
<X>0</X>
<Y>0</Y>
<Width>476</Width>
<IncludeCode></IncludeCode>
<DeclerationCode>int Pin = 0;</DeclerationCode>
<SetupCode>analogReference(INTERNAL);
</SetupCode>
<ImageName>arduino.png</ImageName>
<InfoURL></InfoURL>
<CodeDefinitions>
<CodeDefinition>
<UpdateCondition>EveryUpdate</UpdateCondition>
<Code>Output_temperature = transform(analogRead(Pin), 1, 1024, 0.0, 1.0);</Code>
<UniqueID>e0313d4f-0633-44a9-b6fa-487a871b9bc5</UniqueID>
</CodeDefinition>
</CodeDefinitions>
<Inputs></Inputs>
<Outputs>
<Output>
<UniqueID>02848153-5050-4735-adf2-42684db2894b</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Активация</DefaultName>
<CustomName>temperature</CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeOutput</IOType>
<ShowGraph>True</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<MinValue>0</MinValue>
<MaxValue>1</MaxValue>
<UseNegativeRange>False</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Output>
</Outputs>
</Node>
</Nodes>
Edited by user Friday, March 27, 2015 11:35:18 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/11/2014(UTC) Posts: 661
Thanks: 1 times Was thanked: 109 time(s) in 104 post(s)
|
Thank you, I'll add that to the library. I'll also add a submission form so that users can add to the library themselves, I think that'll be a big help.
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/11/2014(UTC) Posts: 661
Thanks: 1 times Was thanked: 109 time(s) in 104 post(s)
|
I haven't seen the analogReference() function before. Instead of having to do this with a custom Arduino node, I'll add that as an option to the Analog input node.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.