Skip to content

File ADCMux.cpp

File List > ADCMux > ADCMux.cpp

Go to the documentation of this file

Source Code

#include "daisy_seed.h"

using namespace daisy;

DaisySeed hw;

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

    AdcChannelConfig adc_cfg;
    adc_cfg.InitMux(seed::A3, 4, seed::D12, seed::D31);

    hw.adc.Init(&adc_cfg, 1);

    hw.adc.Start();

    hw.StartLog();

    while(1)
    {
        System::Delay(250);
        hw.PrintLine("Input 1: %d", hw.adc.GetMux(0, 0));
        hw.PrintLine("Input 2: %d", hw.adc.GetMux(0, 1));
        hw.PrintLine("Input 3: %d", hw.adc.GetMux(0, 2));
        hw.PrintLine("Input 4: %d", hw.adc.GetMux(0, 3));
    }
}