ArduinoArduino UnoExact chip

Knob to Plotter

Turn the potentiometer; analogRead() follows it. Open the Plotter.

Knob to Plotter in Argynix Lab

The code

sketch.inoC++
// Turn the knob: analogRead() follows it and the LED's brightness too.
// Open the Plotter tab to watch it drawn.

const int KNOB = A0;
const int LED = 9;

void setup() {
  pinMode(LED, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  int raw = analogRead(KNOB);
  analogWrite(LED, raw / 4);
  Serial.print("knob:");
  Serial.println(raw);
  delay(50);
}