# `Pot`
## Description
`Pot` represents a potentiometer.
## Usage
### `erbui`
```erbui
module Example {
control freq Pot { // 1.
position 19.2mm, 111mm // 2.
style rogan, 6ps // 3.
label "FREQ" // 4.
pin AdcPin1 // 5.
}
}
```
1. Creates a button control with name `arm`,
2. Sets the control position on the front panel,
3. Sets the optional style of the control,
4. Sets the optional label for the control, using its default theme positioning,
5. Sets the optional physical board pin to use. If not set, the system will choose it automatically.
> Knobs photos are from the [Thonk shop](https://www.thonk.co.uk/shop/make-noise-mutable-style-knobs/).
### `c++`
`Pot` is a type that abstracts a potentiometer block.
```c++
struct Example
{
ExampleUi ui;
void process () {
float freq_val = ui.freq; // 1.
}
}
```
1. Retrieves the normalised (in the `0.f` to `1.f` range) or bipolar (in the `-1.f` to `1.f` range)
floating-point pot value.
## `erbui` Control Reference
### `control` definition
```
control Pot { ... }
```
Where `` is the name of the control.
More details can be found in [`control`](../erbui/grammar.html#control) documentation.
### `position` property
```
position ,
```
Sets the position of the control, where the axis origin is the top-left corner.
The `x` axis is oriented from left to right, and the `y` axis is oriented from top to bottom.
The position component values are expressed with their unit, either `mm` or `hp`.
Example:
```
position 2hp, 15mm
```
More details can be found in [`position`](../erbui/grammar.html#position) documentation.
### `style` optional property
```
style
```
Where `` is the first best matching subset of:
- `rogan, 2ps, medium, skirt, d_shaft` (this is the default if not specified),
- `rogan, 3ps, large, skirt, d_shaft`,
- `rogan, 1ps, small, skirt, d_shaft`,
- `rogan, 6ps, larger, skirt, d_shaft`,
- `rogan, 5ps, xlarge, skirt, d_shaft`,
- `sifam, selco, small, skirt, d_shaft, white`,
- `sifam, selco, large, skirt, d_shaft, white`.
More details can be found in [`style`](../erbui/grammar.html#style) documentation.
### `label` optional property
```
label ""
```
Where `` is the text displayed.
More details can be found in [`label`](../erbui/grammar.html#label) documentation.
## `c++` Member Functions Synopsys
| Name | Synopsys |
| - | - |
| [`operator float`](#operator-float) | Returns the pot value |
## `c++` Member Functions
### `operator float`
```c++
operator float () const;
```
Returns the pot value.