ADC Reading

Hey,

This is how I did it, although there might be a better way. And I didn’t think this was really obvious!

in the main loop (to setup):

AdcChannelConfig adc[4]; //array size for number of ADC channels you need

adc[0].InitSingle(hw.GetPin(15));
adc[1].InitSingle(hw.GetPin(16));
adc[2].InitSingle(hw.GetPin(17));
adc[3].InitSingle(hw.GetPin(18));

hw.adc.Init(adc, 4); //my DaisySeed instance is called hw
hw.adc.Start();

and then to get the values:

hw.adc.GetFloat(0);
hw.adc.GetFloat(1);

etc

I wrote my own function to scale the outputs with a different curve (Exp, Log etc).

6 Likes