Difference between revisions of "HANcoder/STM32/Blocks/Digital Input"

From OpenMBD
< HANcoder‎ | STM32‎ | Blocks
Jump to: navigation, search
(Created page with "{{HANcoder/block| info= A 'Digital Input' block reads the input level of the selected pin. If the input level is high, '1' is the output, otherwise '0'. |blockImage= Digita...")
 
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
info=
 
info=
A 'Digital Input' block reads the input level of the selected pin. If the input level is high, '1' is the output, otherwise '0'.
+
A 'Digital Input' block reads the input level of the selected pin.If the voltage on the pin comes below the 'low level voltage' the output will switch to 0 and if it comes above the 'high level voltage' it will switch to 1. Please check the datasheet for the voltage levels.
  
  
Line 11: Line 11:
 
DigitalInputMask.png
 
DigitalInputMask.png
  
 +
}}
 +
 +
== Block outputs (outports) ==
 +
A value that indicates the state of the pin. The data type is boolean, 0 for low level and 1 for high level.
 +
 +
== Block parameters ==
 +
{| class="wikitable"
 +
|-
 +
! style="width:150px" | Parameter
 +
! Description
 +
|-
 +
| Input pin
 +
| The input pin to be used for the digital input. Select one from the list. A warning will appear when the pin is already in use in another block.
 +
|-
 +
| Configuration
 +
| The configuration to be used. There are three options:<br/>
 +
- Floating, the pin will not connected in any way to ground or 3.3V<br/>
 +
- Pull up, the pin will be connected to ground through a pull-down resistor<br/>
 +
- Pull down, the pin will be connected to 3.3V through a pull-up resistor
 +
|-
 +
| Sample time
 +
| Sample time of the block. The Sample time (in seconds) defines the rate at which the block is visited by the real-time scheduler of the target. The value of the Sample time has to be an integer multiple of the base sample time of the model.
 +
|}
 +
 +
{{HANcoder/BlockFooter|
 +
|SeeAlso = [[HANcoder/STM32/Blocks/Analog_Input|Analog Input]]
 
}}
 
}}

Latest revision as of 10:02, 5 May 2017

Supported Targets: Olimexino, E407, P405

General information about Digital Input

A 'Digital Input' block reads the input level of the selected pin.If the voltage on the pin comes below the 'low level voltage' the output will switch to 0 and if it comes above the 'high level voltage' it will switch to 1. Please check the datasheet for the voltage levels.

Block

DigitalInput.png

Mask

DigitalInputMask.png

Block outputs (outports)

A value that indicates the state of the pin. The data type is boolean, 0 for low level and 1 for high level.

Block parameters

Parameter Description
Input pin The input pin to be used for the digital input. Select one from the list. A warning will appear when the pin is already in use in another block.
Configuration The configuration to be used. There are three options:

- Floating, the pin will not connected in any way to ground or 3.3V
- Pull up, the pin will be connected to ground through a pull-down resistor
- Pull down, the pin will be connected to 3.3V through a pull-up resistor

Sample time Sample time of the block. The Sample time (in seconds) defines the rate at which the block is visited by the real-time scheduler of the target. The value of the Sample time has to be an integer multiple of the base sample time of the model.

See Also

Analog Input