Difference between revisions of "Component: Potentiometer (EBM002) (EBM Modules)"
Line 14: | Line 14: | ||
==Potentiometer component== | ==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. | 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. | ||
+ | |||
+ | '''Note: The default Vref properties for AVR/Arduino is AREF.''' | ||
+ | '''If there is no voltage being applied to the AREF pin, then you must change Vref option from AREF to AVCC''' | ||
==Component Source Code== | ==Component Source Code== |
Revision as of 08:31, 21 December 2022
Author | Matrix TSL |
Version | 1.1 |
Category | EBM Modules |
Contents
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.
Note: The default Vref properties for AVR/Arduino is AREF. If there is no voltage being applied to the AREF pin, then you must change Vref option from AREF to AVCC
Component Source Code
Please click here for the component source code: 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.
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
![]() |
ReadPotentiometer |
Macro to read the potentiometer Mode = 0 will return a byte Mode = 1 will return an int | |
![]() |
Mode |
0 = return BYTE, 1 = return INT | |
![]() |
Return |