Class fx_pot

Class Documentation

class fx_pot

These functions are used to read the pots (aka the knobs) of the pedal.

Each knob has a value ranging from 0.0 (full counter-clockwise) to 1.0 (full clock-wise).

The first generation hardware has three pots (pedal.pot_left, pedal.pot_center, and pedal.pot_right).

The second generation hardware has five pots (pedal.pot_top_left, ‘pedal.pot_top_right’, ‘pedal.pot_bot_left<tt>,pedal.pot_bot_center<tt>andpedal.pot_bot_right`). To preserve backwards compatibility with sketches developed on the first generation hardware, the pedal.pot_left will map to ‘pedal.pot_bot_left` (and same for center and right pots).

Use the .has_changed() function to determine when a pot has been adjusted by the user.

void loop() {

  if (pedal.pot_left.has_changed()) {
    delay_effect.set_feedback(pedal.pot_left.val);   // Set feedback of delay using left pot
  }

  // Other code in loop()...

Public Functions

bool has_changed(void)

Returns true if this pot has been changed by the user

if (pedal.pot_left.has_changed()) {
  delay_effect.set_feedback(pedal.pot_left.val);   // Set feedback of delay using left pot
}
.

Return

True if changed, False otherwise.

void read_pot()
fx_pot(int pin)

Public Members

float val

Current value of pot (0.0 to 1.0)

float val_inv

Current value of pot (1.0 to 0.0)

float val_log

Current value of pot with log curve applied (still 0.0 to 1.0)

float val_log_inv

Current value of pot with inverse log curve applied (still 0.0 to 1.0)