#include <Arduino.h>
const uint8_t ANALOG_PIN = A0;
const uint8_t DIGITAL_PIN = 3;
const uint8_t LED_PIN = 13;
void setup() {
  Serial.begin(9600);
  pinMode(DIGITAL_PIN, INPUT);
  pinMode(LED_PIN, OUTPUT);
}
void loop() {
  // AO is an instantaneous voltage sample, not loudness in decibels or recorded audio.
  const int analogValue = analogRead(ANALOG_PIN);
  // DO is the comparator's threshold output; the trimmer controls that threshold.
  const int digitalValue = digitalRead(DIGITAL_PIN);
  Serial.println(analogValue);
  // Preserve the supplied HIGH-following behavior; some modules trigger LOW instead.
  if (digitalValue == HIGH) digitalWrite(LED_PIN, HIGH);
  else digitalWrite(LED_PIN, LOW);
  delay(50);  // About 20 printed samples/s, far too slow to reconstruct ordinary audio.
}
