Description

A potentiometer, (also referred to as POT) is a simple knob that provides a variable resistance, thus varying the output analog value in accordance with the rotation of the knob.

Block description

This block can be used in analog mode to receive inputs (integer values) from a potentiometer connected to any of the ports S1, S2, S3.

Hardware interface

Connecting an external potentiometer

Note: While connecting an external sensor to the Cloudio board, care must be taken to match the polarities of the sensor with that of the port (S1/S2/S3) that it is being connected to.

Pot Hw

App interface and usage

Port selection:

Here you can select the port the potentiometer is connected to - S1/S2/S3.
Pot Port

Operator:

Here, you can select the operator to be used while comparing the potentiometer values against threshold values set in the next step.
Pot Port

Value:

You can set a threshold value for comparison in the range 0 to 999. You can use the Read option to read/receive real-time values from the port selected.
Pot Port

After you set the parameters for the block, you can press Done to confirm and save your changes.

Example

The below project snippet turns the LED red if the reading from the potentiometer is less than 500 and green if the reading is greater than or equal to 700.

Note: This is a code snippet to explain the working of the block. In this case, this code will be executed once and at the time of uploading the code.
You will need to use this snippet inside a loop infinitely block if you want this code to run on the board for the entire duration that the board is on.
Pot Ex

Also read

Input
Control