lancaster-university / microbit-dal

http://lancaster-university.github.io/microbit-docs
Other
258 stars 131 forks source link

Add some flexibility to the way the ADC is read or used #322

Open jaustin opened 7 years ago

jaustin commented 7 years ago

It would be great to expose (at least) the following options to users of the ADC:

(discussed in #318 )

It looks like this would be a departure from the mbed AnalogIn which doesn't appear to have this option - but there's already some direct ADC control in MicroBitPin.cpp

For the first point, as we currently really only expose the ADC via the pins, this would be a bit odd - so certainly worth considering a more fixed-use-case solution to measuring the supply voltage (IE like https://os.mbed.com/teams/microbit/code/microbit-battery-test/). For the second it feels like we should be able to work by extending the existing API.

@dpgeorge - not sure if you watch DAL issues but I think this one is of some interest