AnalogControl example?

Hey there, fairly new to Daisy (and C++) but loving it so far!
Just wondering if there are any guides/examples out there for some of the libDaisy APIs, more specifically AnalogControl? Managed to get Led and Switch working by trial and error, controlling brightness of an LED with a potentiometer but would like to eventually be able to use the AnalogControl class.

Also following along with the examples I was unable to use pin names like D5, A0 etc and had to use hw.GetPin(), is there something I’m missing there?
Thanks in advance for any knowledge you may be able to share!

#include "daisy_seed.h"
#include "daisysp.h"

using namespace daisy;
using namespace daisysp;

DaisySeed hw;

Switch b[4];
Led    l[4];

bool  bState[4];
float val[4];

void AudioCallback(AudioHandle::InputBuffer  in,
                   AudioHandle::OutputBuffer out,
                   size_t                    size)
{
    for(size_t i = 0; i < size; i++)
    {
        out[0][i] = in[0][i];
        out[1][i] = in[1][i];
    }
}

void update()
{
    for(int i = 0; i < 4; i++)
    {
        b[i].Debounce();
        bState[i] = b[i].Pressed();


        l[i].Set(val[i]);
        l[i].Update();


        val[i] = hw.adc.GetFloat(i);
    }
}

int main(void)
{
    hw.Configure();
    hw.Init();
    hw.StartLog();

    hw.SetAudioBlockSize(4); // number of samples handled per callback
    hw.SetAudioSampleRate(SaiHandle::Config::SampleRate::SAI_48KHZ);
    hw.StartAudio(AudioCallback);

    AdcChannelConfig adc_config[4];
    int              x = 18;
    for(int i = 0; i < 4; i++)
    {
        b[i].Init(hw.GetPin(i));
        l[i].Init(hw.GetPin(i + 4), 0, 1000.0);
        adc_config[i].InitSingle(hw.GetPin(x));
        x--;
    }

    hw.adc.Init(adc_config, 4);
    hw.adc.Start();


    while(1)
    {
        update();
    }
}

This can be quite confusing, and isn’t helped by the diagram Electro-Smith uses on the Daisy Seed page.

Here is another pinout I found on the web - the numbers in BLUE are what is used in libDaisy, along with hw.GetPin().

Pin names starting with A or D (as shown in that other diagram) are only for use in DaisyDuino.

Look at DaisyExamples/seed/Knob/Knob.cpp, and also see its accompanying Fritzing diagram. You’ll see that the pin which has the physical number 28 (counting around the pins on the seed) is called pin 21 in libDaisy; the same pin is called A6 or D21 in DaisyDuino.