|
|
| (11 intermediate revisions by 2 users not shown) |
| Line 17: |
Line 17: |
| ==Component Source Code== | | ==Component Source Code== |
|
| |
|
| Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_EBM002v1.fcfx FC_Comp_Source_EBM002v1.fcfx] | | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_EBM002v1.fcfx FC_Comp_Source_EBM002v1.fcfx] |
|
| |
|
| Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EBM002v1.fcfx FC_Comp_Source_EBM002v1.fcfx] | | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EBM002v1.fcfx FC_Comp_Source_EBM002v1.fcfx] |
|
| |
|
| ==Detailed description== | | ==Detailed description== |
| | |
| | |
| | |
| | |
|
| |
|
|
| |
|
| Line 44: |
Line 48: |
|
| |
|
| ==Examples== | | ==Examples== |
| | |
| | |
| | |
| | |
|
| |
|
|
| |
|
| Line 71: |
Line 79: |
| The ADC bit depth can be increased to 10 or 12 bit depending on your device by changing the Mode parameter to 1 in the ReadPotentiometer component macro. | | The ADC bit depth can be increased to 10 or 12 bit depending on your device by changing the Mode parameter to 1 in the ReadPotentiometer component macro. |
|
| |
|
|
| |
| ==Macro reference==
| |
|
| |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPotentiometer'''
| |
| |-
| |
| | colspan="2" | Macro to read the potentiometer Mode = 0 will return a byte Mode = 1 will return an int
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| |
| | width="90%" | Mode
| |
| |-
| |
| | colspan="2" | 0 = return BYTE, 1 = return INT
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
|
| |
|
|
| |
|
| ==Property reference==
| |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
| |
| | width="90%" | Channel 1
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
| | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Settings
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| |
| | width="90%" | VRef voltage
| |
| |-
| |
| | colspan="2" | +Vref voltage x 10mV Default 500 = 5V
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| | width="90%" | VRef option
| |
| |-
| |
| | colspan="2" | Defines what is used as the ADC Vref source.
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| | width="90%" | Conversion speed
| |
| |-
| |
| | colspan="2" | Clock setting to set how fast the ADC peripheral is driven.
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| |
| | width="90%" | Aquisition cycles
| |
| |-
| |
| | colspan="2" | Number of micro seconds to wait for the ACD input to charge before starting the analogue sample.
| |
| |}==Macro reference==
| |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPotentiometer'''
| |
| |-
| |
| | colspan="2" | Macro to read the potentiometer Mode = 0 will return a byte Mode = 1 will return an int
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| |
| | width="90%" | Mode
| |
| |-
| |
| | colspan="2" | 0 = return BYTE, 1 = return INT
| |
| |-
| |
| | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| |
| | width="90%" style="border-top: 2px solid #000;" | ''Return''
| |
| |}
| |
|
| |
|
|
| |
|
|
| |
|
|
| |
|
| ==Property reference==
| |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;"
| | ==Macro reference== |
| |-
| |
| | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
| |
| | width="90%" | Channel 1
| |
| |-
| |
| | colspan="2" |
| |
| |-
| |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| |
| | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Settings
| |
| |-
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| |
| | width="90%" | VRef voltage
| |
| |-
| |
| | colspan="2" | +Vref voltage x 10mV Default 500 = 5V
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| | width="90%" | VRef option
| |
| |-
| |
| | colspan="2" | Defines what is used as the ADC Vref source.
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| |
| | width="90%" | Conversion speed
| |
| |-
| |
| | colspan="2" | Clock setting to set how fast the ADC peripheral is driven.
| |
| |-
| |
| | width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
| |
| | width="90%" | Aquisition cycles
| |
| |-
| |
| | colspan="2" | Number of micro seconds to wait for the ACD input to charge before starting the analogue sample.
| |
| |}==Macro reference==
| |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | ===ReadPotentiometer=== |
| | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPotentiometer''' | | | width="90%" class="mtx-class-macrohead" | '''ReadPotentiometer''' |
| |- | | |- |
| | colspan="2" | Macro to read the potentiometer Mode = 0 will return a byte Mode = 1 will return an int | | | colspan="2" | Macro to read the potentiometer Mode = 0 will return a byte Mode = 1 will return an int |
| Line 206: |
Line 109: |
| | width="90%" style="border-top: 2px solid #000;" | ''Return'' | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| |} | | |} |
|
| |
|
| |
|
| |
|
|
| |
|
| ==Property reference== | | ==Property reference== |
|
| |
|
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="mtx-class-macrotable wikitable" |
| |- | | |- |
| | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] |
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | | | width="90%" class="mtx-class-macrohead" | '''Properties''' |
| |- | | |- |
| |- | | |- |
| Line 223: |
Line 124: |
| | colspan="2" | | | | colspan="2" | |
| |- | | |- |
| | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] |
| | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Settings | | | width="90%" class="mtx-class-propfolder" | Settings |
| |- | | |- |
| |- | | |- |
| Author
|
Matrix TSL
|
| Version
|
1.1
|
| Category
|
EBM Modules
|
Potentiometer component
This board consists of a standard shaft rotary potentiometer that provides a linear voltage output ranging between the microcontroller power rails. This can be connected to an Analogue to Digital input of the microcontroller in order to provide a control value.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_EBM002v1.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_EBM002v1.fcfx
Detailed description
No detailed description exists yet for this component
Examples
This example simply reads the value from the potentiometer sensor component and outputs the value to an LCD as a number in the range 0-255.
EBM002 Example
The ADC bit depth can be increased to 10 or 12 bit depending on your device by changing the Mode parameter to 1 in the ReadPotentiometer component macro.
Macro reference
ReadPotentiometer
|
ReadPotentiometer
|
| Macro to read the potentiometer Mode = 0 will return a byte Mode = 1 will return an int
|
- BOOL
|
Mode
|
| 0 = return BYTE, 1 = return INT
|
- INT
|
Return
|
Property reference
|
Properties
|
|
Channel 1
|
|
|
|
Settings
|
|
VRef voltage
|
| +Vref voltage x 10mV Default 500 = 5V
|
|
VRef option
|
| Defines what is used as the ADC Vref source.
|
|
Conversion speed
|
| Clock setting to set how fast the ADC peripheral is driven.
|
|
Aquisition cycles
|
| Number of micro seconds to wait for the ACD input to charge before starting the analogue sample.
|