Difference between revisions of "IO Properties"
(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...") |
|||
Line 11: | Line 11: | ||
===Creating a property=== | ===Creating a property=== | ||
+ | |||
+ | First click on a blank area of the 2D or 3D panels to select the root "Panel" object. You can also use the drop down menu at the top of the Properties window. | ||
Open up the properties window and click the drop down arrow next to the Properties item in the window. | Open up the properties window and click the drop down arrow next to the Properties item in the window. |
Revision as of 09:53, 6 August 2018
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
First click on a blank area of the 2D or 3D panels to select the root "Panel" object. You can also use the drop down menu at the top of the Properties window.
Open up the properties window and click the drop down arrow next to the Properties item in the window.
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
Click OK.
You now have a new pin connection available on the properties window.
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.
To output a logic high to the pin connection simply use an equals character to assign 1 to the pin.
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.