Embrio Forum
»
Embrio Support
»
Programming with Embrio
»
Any way to handle float values as output?
Rank: Newbie
Groups: Registered
Joined: 12/30/2015(UTC) Posts: 4 Was thanked: 2 time(s) in 2 post(s)
|
Hey Guys,
is there any way to handle float values as output of a custom node? I'm working on a temperature controlled device, where I need to acess the temperatures in degree celsius, but I can't find a way yet. I only get int or a float from 0 to 1 what doesn't helps me.
If there isn't a way yet, it's (in my opinion) a feature which has to be implemented asap. I can't imagine coding without flaots.
NG Dr. Console
|
1 user thanked Dr. Console for this useful post.
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/11/2014(UTC) Posts: 661
Thanks: 1 times Was thanked: 109 time(s) in 104 post(s)
|
Activations are the closest things, but those are clamped to be between -1 and 1. Activation values are important to how things are done in Embrio and it helps to have values in that range. The idea is that values would be converted to that range for processing, then transformed before being written out to a display or something.
What sort of flow or processing are you looking to do to the degree value as a float? I added the whole number input/output type because people requested it, I might do the same for floats if it's really needed, but I'd prefer not to if the same calculations can be done on activations.
|
1 user thanked EmbrioAdmin for this useful post.
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/11/2014(UTC) Posts: 661
Thanks: 1 times Was thanked: 109 time(s) in 104 post(s)
|
In the Embrio way of doing things, if I was working with a temperature it would be transformed into an activation from an arbitrary range. Program flow control in Embrio is done with things like "above or below" nodes, which all work on activations. So if I was controlling a thermostat the input temperature would be converted from say 20 degrees to 120 degrees F into an activation from 0 to 1. It would run through an Above or Below node that would turn on and off a burner. Here it is pasted below. Let me know if that workflow makes sense or you really need a new i/o type.
<EmbrioCopy> <Version>1.3.1.0</Version> <Nodes> <Node> <UniqueID>22097539-aeb9-4bb1-98d9-48b96a853502</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>0</X> <Y>0</Y> <Width>448</Width> <IncludeCode></IncludeCode> <DeclerationCode></DeclerationCode> <SetupCode></SetupCode> <ImageName>arduino.png</ImageName> <InfoURL></InfoURL> <CodeDefinitions> <CodeDefinition> <UpdateCondition>EveryUpdate</UpdateCondition> <Code>// Get degF from the sensor Output_Activation = transform(degF, 20, 120, 0.0, 1.0);</Code> <UniqueID>bacbcbf8-3583-4ac5-b35f-75c6585c57a3</UniqueID> </CodeDefinition> </CodeDefinitions> <Inputs></Inputs> <Outputs> <Output> <UniqueID>fad6153d-fc17-4f06-a6ef-a57e71de35fd</UniqueID> <DefinitionID>00000000-0000-0000-0000-000000000000</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>True</IsUserAdded> <MinValue>0</MinValue> <MaxValue>1</MaxValue> <UseNegativeRange>False</UseNegativeRange> <CanUseNegativeRange>True</CanUseNegativeRange> </Output> </Outputs> </Node> <Node> <UniqueID>5e0adfc7-b51f-4f84-9ad9-c0a95bb40fc8</UniqueID> <AssemblyType>Embrio.NodeEngine.AgentController.Nodes.DynamicNode</AssemblyType> <NodeType>Integer To Activation</NodeType> <UserDefinedName></UserDefinedName> <Description></Description> <NodeColor>201,204,227,255</NodeColor> <X>190</X> <Y>503</Y> <Width>260</Width> <DefinitionID>b27b71b2-da17-4e16-9153-7996feb2ab65</DefinitionID> <Inputs> <Input> <UniqueID>1017dbe1-8ed6-4351-a5c4-35c325ba5299</UniqueID> <DefinitionID>76dd32eb-a366-461b-9954-2e144fa4bdf5</DefinitionID> <DefaultName>Integer</DefaultName> <CustomName>Target Temperature</CustomName> <IsDisplayed>True</IsDisplayed> <IsNative>False</IsNative> <TypeName>Integer</TypeName> <IsOutsideConnection>False</IsOutsideConnection> <IOType>Embrio.NodeEngine.NodeIO.IntegerNodeInput</IOType> <ShowGraph>False</ShowGraph> <LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID> <IsUserAdded>False</IsUserAdded> <ConnectedOutputs></ConnectedOutputs> <DisconnectedValue>73</DisconnectedValue> <MinValue>20</MinValue> <MaxValue>120</MaxValue> </Input> </Inputs> <Outputs> <Output> <UniqueID>94d0cceb-4f15-4a2a-8017-9c0457ae91c9</UniqueID> <DefinitionID>c6b88f6e-713b-4b57-afd0-735472782c28</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>0</MinValue> <MaxValue>1</MaxValue> <UseNegativeRange>False</UseNegativeRange> <CanUseNegativeRange>True</CanUseNegativeRange> </Output> </Outputs> </Node> <Node> <UniqueID>30fdb654-8be2-4221-9b8c-8851362dfd32</UniqueID> <AssemblyType>Embrio.NodeEngine.AgentController.Nodes.DynamicNode</AssemblyType> <NodeType>Above Or Below</NodeType> <UserDefinedName></UserDefinedName> <Description></Description> <NodeColor>229,229,197,255</NodeColor> <X>517</X> <Y>440</Y> <Width>260</Width> <DefinitionID>803ca066-5ae9-40d5-995e-a6129bfc66e0</DefinitionID> <Inputs> <Input> <UniqueID>28dbb915-5631-477e-bcd4-29aed4835540</UniqueID> <DefinitionID>c4e2db53-3c10-4bf8-8e12-6763f260c3a7</DefinitionID> <DefaultName>Activation</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> <Output>fad6153d-fc17-4f06-a6ef-a57e71de35fd</Output> </ConnectedOutputs> <BlendMode>Add</BlendMode> <DisconnectedValue>0.392</DisconnectedValue> <UseNegativeRange>False</UseNegativeRange> <CanUseNegativeRange>True</CanUseNegativeRange> </Input> <Input> <UniqueID>1f766201-49fe-4de9-a21b-f08c04c5923e</UniqueID> <DefinitionID>90280674-f172-491c-884d-65cfaafce749</DefinitionID> <DefaultName>Threshold</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> <Output>94d0cceb-4f15-4a2a-8017-9c0457ae91c9</Output> </ConnectedOutputs> <BlendMode>Add</BlendMode> <DisconnectedValue>0.591</DisconnectedValue> <UseNegativeRange>False</UseNegativeRange> <CanUseNegativeRange>True</CanUseNegativeRange> </Input> </Inputs> <Outputs> <Output> <UniqueID>d41eede7-f711-4d62-bfb3-f79229c74df8</UniqueID> <DefinitionID>fec4d985-9c06-492e-8c85-4a951991374c</DefinitionID> <DefaultName>Is Above</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>0</MinValue> <MaxValue>1</MaxValue> <UseNegativeRange>False</UseNegativeRange> <CanUseNegativeRange>True</CanUseNegativeRange> </Output> <Output> <UniqueID>8a2ef7c3-eca0-47d5-9a1a-ff3091abb583</UniqueID> <DefinitionID>181dc578-b2b2-4e64-940f-21744864dbc4</DefinitionID> <DefaultName>Is Below</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>0</MinValue> <MaxValue>1</MaxValue> <UseNegativeRange>False</UseNegativeRange> <CanUseNegativeRange>True</CanUseNegativeRange> </Output> <Output> <UniqueID>a52559a0-26b3-400b-9992-ad94c626c842</UniqueID> <DefinitionID>a1e9c4dc-e0a8-43ee-8ba5-1106875206b4</DefinitionID> <DefaultName>Go Above</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>eabdc9b0-3b5d-403b-b8c9-fee81cfb8cb0</UniqueID> <DefinitionID>7484cea2-1c87-402e-b52f-593da1c78ffc</DefinitionID> <DefaultName>Go Below</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>da7713b3-1ace-47b8-8ce6-60c47575787c</UniqueID> <DefinitionID>714c130c-29cc-44d9-afe9-184e73a96428</DefinitionID> <DefaultName>Toggle</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>159a93a3-058c-43ef-8531-8447a06ce995</UniqueID> <AssemblyType>Embrio.NodeEngine.AgentController.Nodes.AgentControllerOutputNode</AssemblyType> <NodeType>Controller Output</NodeType> <UserDefinedName>Burner</UserDefinedName> <Description>Sets either an analog or digital output pin on the Arduino.</Description> <NodeColor>144,183,227,255</NodeColor> <X>834</X> <Y>533</Y> <Width>260</Width> <PinType>Digital</PinType> <RangeMin>0</RangeMin> <RangeMax>255</RangeMax> <Pin>D13</Pin> <UpdateCondition>InputChange</UpdateCondition> <DebugIndex>0</DebugIndex> <DebugBoolIndex>0</DebugBoolIndex> <Inputs> <Input> <UniqueID>f374c7dc-c2c2-4832-b00a-b81483e644be</UniqueID> <DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID> <DefaultName>Activation</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> <Output>8a2ef7c3-eca0-47d5-9a1a-ff3091abb583</Output> </ConnectedOutputs> <BlendMode>Add</BlendMode> <DisconnectedValue>0</DisconnectedValue> <UseNegativeRange>False</UseNegativeRange> <CanUseNegativeRange>True</CanUseNegativeRange> </Input> </Inputs> <Outputs></Outputs> </Node> </Nodes> </EmbrioCopy>
|
1 user thanked EmbrioAdmin for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/30/2015(UTC) Posts: 4 Was thanked: 2 time(s) in 2 post(s)
|
Well, first thanks for the fast reply.
I'm building a device, which regulates the temp. in a special box in a very tiny range of abaut 0.5-1°C around a user defined temperature. Because I don't know the temp the user will define it's hard to do without float values holding the needed precision. Also I think that the basic types like float, byte, int and string are a must have for a programming software.
If I think back to another project I made with radio modules it's impossible without byte, String, Float and struct types.
I will just for fun try it with the activation output, but I didn't expect much success.
NG Dr. Console
|
1 user thanked Dr. Console for this useful post.
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/11/2014(UTC) Posts: 661
Thanks: 1 times Was thanked: 109 time(s) in 104 post(s)
|
The problem is there isn't much you can do with a float in Embrio. Most nodes do things with activations, the reason I'm hesitant to add more variable types is it would mean adding more nodes to deal with those values. String and integer types are there. In the Embrio philosophy it makes more sense to use 0 and 1 activations for bools. You might be right about floats which might need their own few nodes like integers have now. I'll think more about it.
I still think your best bet is to convert that degree value to an activation using the built in transform function. I think the only issue you might have is letting the user set the range but that would depend on your input system.
|
1 user thanked EmbrioAdmin for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 12/30/2015(UTC) Posts: 4 Was thanked: 2 time(s) in 2 post(s)
|
Well, at the moment it's hard to try, because I have another general problem with the seonsor, but if it would work with activation depends on the precision the acctivation works with.
e.g. the devices working range should be -55 to +80°C means 135°C temp range. At a precision of 0.5°C. So the actiovation value has to have a presicion of 0.00370370..... I don't know yet how many decimal numbers you have included. Would be interestring.
NG Dr. Console
|
|
|
|
Embrio Forum
»
Embrio Support
»
Programming with Embrio
»
Any way to handle float values as output?
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.