Component: Potentiometer (EBM002) (EBM Modules)

From Flowcode Help
Jump to navigationJump to search
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.