IO Properties

From Flowcode Help
Revision as of 09:50, 6 August 2018 by BenR (talk | contribs) (Created page with "==Introduction== Most embedded components will require some form of connection to the real world. This is usually done via the standard input/output pins of the microcontroll...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

Most embedded components will require some form of connection to the real world. This is usually done via the standard input/output pins of the microcontroller.

This topic will deal with creating properties to allow your component to interact with the microcontroller pins specified by the user of the component.


Single Digital Pin

The first type of pin connection we will look at is a single digital pin, this can be used for input or output purposes and is the most common type of pin connection.

Creating a property

Open up the properties window and click the drop down arrow next to the Properties item in the window.

Prop1.jpg

Select Add New from the menu.

Give the property a cosmetic name, we have used Pin Connection

Select single digital pin from the drop down list

Give the property a property variable, we have used Pin

Prop2.jpg

Click OK.

You now have a new pin connection available on the properties window.

Prop3.jpg


Referencing the property

To reference the property simply use the variable name inside a calculation icon.

To output a logic low to the pin connection simply use an equals character to assign the value 0 to the pin.

Prop4.jpg


To output a logic high to the pin connection simply use an equals character to assign 1 to the pin.

Prop5.jpg


To read the logic level of an input voltage connected to the pin simply use an equals character to assign the pin to a variable.

Prop6.jpg