Rank: Member
Groups: BetaUser, Registered Joined: 5/24/2015(UTC) Posts: 17
Was thanked: 1 time(s) in 1 post(s)
|
I have a project that I think the Embrio event style would be helpful but am unsure how to get going.
I'm using: Adafruit 7 SEG led i2c board which uses 2 libraries bluetooth via Software serial a RTC using the RTClib library
Basically I'm making a clock display that can do the following from input via Bluetooth:
Display a fixed time i.e. 9:00 Increment the hour increment the Minute and also hour if Increment goes beyond 59 reset time to the last set time Display current time Display running time based on set time
|
1 user thanked blanius 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)
|
Yeah that shouldn't be too tough. You'll write to the LCD with a custom Arduino node. It should have 2 integer inputs, one for hours and one for minutes. The print function would combine those into a display string to send to the LCD. Visual programming is great for the overall program flow, but sometimes when you need some more advanced or specific functionality it's better to write a new node instead of trying to build your functionality out of existing nodes. Pasted below is a new node that should give you a good starting point. It lets you manually set the current time in hours and minutes, as well as has a trigger for incrementing the minutes. Copy the text in the below Spoiler tag and paste it into Embrio. To edit the node, right click on it and select "Edit node definition". Let me know if that helps or if you get stuck on something!
<EmbrioCopy> <Version>1.3.6.0</Version> <Nodes> <Node> <UniqueID>6e539455-9ccd-4f6a-90bf-8d6b97f3e04d</UniqueID> <AssemblyType>Embrio.NodeEngine.AgentController.Nodes.DynamicNode</AssemblyType> <NodeType>Time Test</NodeType> <UserDefinedName></UserDefinedName> <Description></Description> <NodeColor>201,204,227,255</NodeColor> <X>0</X> <Y>0</Y> <Width>260</Width> <DefinitionID>a509c220-2a8c-4186-95f8-cbdf8662a491</DefinitionID> <Inputs> <Input> <UniqueID>24f38d4f-97d1-4180-9bd9-3e4525ca273a</UniqueID> <DefinitionID>272cf322-73c9-4c28-915b-86641696edc1</DefinitionID> <DefaultName>Hours</DefaultName> <CustomName></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>4</DisconnectedValue> <MinValue>0</MinValue> <MaxValue>23</MaxValue> </Input> <Input> <UniqueID>c95bf481-8444-4679-8118-fb9d8dd55e60</UniqueID> <DefinitionID>95f27e20-e6fe-4969-bd41-73ff7076da1b</DefinitionID> <DefaultName>Minutes</DefaultName> <CustomName></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>53</DisconnectedValue> <MinValue>0</MinValue> <MaxValue>59</MaxValue> </Input> <Input> <UniqueID>2f0219b8-6b7e-4348-bfd3-b512d8c7a0db</UniqueID> <DefinitionID>2fafb99b-723b-4795-b580-1e24818aa3e9</DefinitionID> <DefaultName>Set Time</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>fd7f086c-b4c9-46c7-9e1a-9fa932831cd8</UniqueID> <DefinitionID>e5074190-0dcd-4a9a-a219-646271fd84e1</DefinitionID> <DefaultName>Increment Minutes</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> </Inputs> <Outputs> <Output> <UniqueID>151184c1-7522-45bd-9f16-171166d3df6b</UniqueID> <DefinitionID>f8ef6a22-8600-4f4e-ac19-102b02223f19</DefinitionID> <DefaultName>Hours</DefaultName> <CustomName></CustomName> <IsDisplayed>True</IsDisplayed> <IsNative>False</IsNative> <TypeName>Integer</TypeName> <IsOutsideConnection>False</IsOutsideConnection> <IOType>Embrio.NodeEngine.NodeIO.IntegerNodeOutput</IOType> <ShowGraph>False</ShowGraph> <LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID> <IsUserAdded>False</IsUserAdded> <MinValue>0</MinValue> <MaxValue>23</MaxValue> </Output> <Output> <UniqueID>b27a3f11-c787-4198-9cf4-17c14636d5d5</UniqueID> <DefinitionID>5a5aa3e6-e237-474e-a8f0-4aba9f6c2a83</DefinitionID> <DefaultName>Minutes</DefaultName> <CustomName></CustomName> <IsDisplayed>True</IsDisplayed> <IsNative>False</IsNative> <TypeName>Integer</TypeName> <IsOutsideConnection>False</IsOutsideConnection> <IOType>Embrio.NodeEngine.NodeIO.IntegerNodeOutput</IOType> <ShowGraph>False</ShowGraph> <LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID> <IsUserAdded>False</IsUserAdded> <MinValue>0</MinValue> <MaxValue>59</MaxValue> </Output> </Outputs> </Node> </Nodes> <NodeDefinitions> <Definition> <Name>Time Test</Name> <NodeColor>201,204,227,255</NodeColor> <UniqueID>a509c220-2a8c-4186-95f8-cbdf8662a491</UniqueID> <ImageExtension></ImageExtension> <Description></Description> <IsBuiltIn>False</IsBuiltIn> <CategoryName>Project</CategoryName> <InputDefinitions> <InputDefinition> <Type>Embrio.NodeEngine.Definitions.IntegerNodeInputDefinition</Type> <UniqueID>272cf322-73c9-4c28-915b-86641696edc1</UniqueID> <Name>Hours</Name> <IsOutsideConnection>False</IsOutsideConnection> <DisconnectedValue>0</DisconnectedValue> <MinValue>0</MinValue> <MaxValue>23</MaxValue> </InputDefinition> <InputDefinition> <Type>Embrio.NodeEngine.Definitions.IntegerNodeInputDefinition</Type> <UniqueID>95f27e20-e6fe-4969-bd41-73ff7076da1b</UniqueID> <Name>Minutes</Name> <IsOutsideConnection>False</IsOutsideConnection> <DisconnectedValue>0</DisconnectedValue> <MinValue>0</MinValue> <MaxValue>59</MaxValue> </InputDefinition> <InputDefinition> <Type>Embrio.NodeEngine.Definitions.TriggerNodeInputDefinition</Type> <UniqueID>2fafb99b-723b-4795-b580-1e24818aa3e9</UniqueID> <Name>Set Time</Name> <IsOutsideConnection>False</IsOutsideConnection> </InputDefinition> <InputDefinition> <Type>Embrio.NodeEngine.Definitions.TriggerNodeInputDefinition</Type> <UniqueID>e5074190-0dcd-4a9a-a219-646271fd84e1</UniqueID> <Name>Increment Minutes</Name> <IsOutsideConnection>False</IsOutsideConnection> </InputDefinition> </InputDefinitions> <OutputDefinitions> <OutputDefinition> <Type>Embrio.NodeEngine.Definitions.IntegerNodeOutputDefinition</Type> <UniqueID>f8ef6a22-8600-4f4e-ac19-102b02223f19</UniqueID> <Name>Hours</Name> <IsOutsideConnection>False</IsOutsideConnection> <MinValue>0</MinValue> <MaxValue>23</MaxValue> </OutputDefinition> <OutputDefinition> <Type>Embrio.NodeEngine.Definitions.IntegerNodeOutputDefinition</Type> <UniqueID>5a5aa3e6-e237-474e-a8f0-4aba9f6c2a83</UniqueID> <Name>Minutes</Name> <IsOutsideConnection>False</IsOutsideConnection> <MinValue>0</MinValue> <MaxValue>59</MaxValue> </OutputDefinition> </OutputDefinitions> <Variables></Variables> <UpdateCodes> <UpdateCode> <TriggerInputID>2fafb99b-723b-4795-b580-1e24818aa3e9</TriggerInputID> <UpdateCondition>Trigger</UpdateCondition> <Code>Output_Hours = Input_Hours; Output_Minutes = Input_Minutes;</Code> <UniqueID>3765ba8f-2cc9-4899-bc08-21a8b00739e2</UniqueID> </UpdateCode> <UpdateCode> <TriggerInputID>e5074190-0dcd-4a9a-a219-646271fd84e1</TriggerInputID> <UpdateCondition>Trigger</UpdateCondition> <Code>Output_Minutes = Output_Minutes + 1; if (Output_Minutes &gt; 59) { Output_Hours = Output_Hours + 1; Output_Minutes = 0; }</Code> <UniqueID>7c6db9d3-6a59-46b7-be05-425b311aadb1</UniqueID> </UpdateCode> </UpdateCodes> </Definition> </NodeDefinitions> </EmbrioCopy>
|
1 user thanked EmbrioAdmin for this useful post.
|
|
|
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.