Difference between revisions of "Component: Potentiometer (EBM002) (EBM Modules)"

From Flowcode Help
Jump to navigationJump to search
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.1 (Release)
+
| 1.1
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| EBM Modules
 
| 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.
  
==[[File:Component Icon 9a0503ff_2954_445e_9032_3465a05f8f82.png|Image]] Potentiometer (EBM002) component==
+
==Component Source Code==
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
+
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]
Analogue to Digital input of the microcontroller in order to provide a control value.
+
 
 +
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==
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
''No detailed description exists yet for this component''
  
 
==Examples==
 
==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.
 
  
{{Fcfile|EBM002 - Test Program.fcfx|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.
 
  
  
==Downloadable macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>ReadPotentiometer</tt></u></span>===
 
Macro to read the potentiometer
 
  
Mode = 0 will return a byte
 
  
Mode = 1 will return an int
 
  
'''Parameters'''
 
  
:[[Variable Types|BOOL]] ''Mode''
 
::0 = return BYTE, 1 = return INT
 
  
  
'''Return value'''
 
  
:[[Variable Types|INT]]
 
  
  
  
==Simulation macro reference==
 
  
''This component does not contain any simulation macros''
 
  
  
==Property reference==
 
<span style="font-weight: normal;"><u>Channel 1</u></span>
 
  
This property is of type ''Single analog pin'' and can be referenced with the variable name ''CHANNEL1''.
 
  
''<span style="color:red;">No additional information</span>''
 
  
  
  
<span style="font-weight: normal;"><u>VRef voltage</u></span>
 
  
This property is of type ''Signed integer'' and can be referenced with the variable name ''vrefvol''.
+
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.
 +
 
 +
{{Fcfile|EBM002 - Test Program.fcfx|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.
 +
 
 +
 
 +
 
 +
 
 +
 
  
+Vref voltage x 10mV
 
  
Default 500 = 5V
 
  
<span style="font-weight: normal;"><u>VRef option</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''vrefop''.
 
  
Defines what is used as the ADC Vref source.
 
  
<span style="font-weight: normal;"><u>Conversion speed</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''convspd''.
+
==Macro reference==
  
Clock setting to set how fast the ADC peripheral is driven.
+
===ReadPotentiometer===
 +
{| 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&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" | Mode
 +
|-
 +
| colspan="2" | 0 = return BYTE, 1 = return INT&nbsp;
 +
|-
 +
| 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''
 +
|}
  
<span style="font-weight: normal;"><u>Aquisition cycles</u></span>
 
  
This property is of type ''Signed integer'' and can be referenced with the variable name ''actime''.
+
==Property reference==
  
Number of micro seconds to wait for the ACD input to charge before starting the analogue sample.
+
{| 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" | &nbsp;
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| 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.&nbsp;
 +
|-
 +
| 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.&nbsp;
 +
|-
 +
| 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.&nbsp;
 +
|}

Latest revision as of 13:09, 7 February 2023

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.

FC6 Icon.png 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

Fc9-comp-macro.png ReadPotentiometer
Macro to read the potentiometer Mode = 0 will return a byte Mode = 1 will return an int 
Fc9-bool-icon.png - BOOL Mode
0 = return BYTE, 1 = return INT 
Fc9-s16-icon.png - INT Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-6-icon.png Channel 1
 
Fc9-conn-icon.png Settings
Fc9-type-14-icon.png VRef voltage
+Vref voltage x 10mV Default 500 = 5V 
Fc9-type-16-icon.png VRef option
Defines what is used as the ADC Vref source. 
Fc9-type-16-icon.png Conversion speed
Clock setting to set how fast the ADC peripheral is driven. 
Fc9-type-14-icon.png Aquisition cycles
Number of micro seconds to wait for the ACD input to charge before starting the analogue sample.