Library for 4051 analog Multiplexer / Demultiplexer

Hi Rob,

Thanks for the feedback.

Okay so I'm going to take the first and last points first. After some mucking around I was getting some namespace issues (more pertinent on the write side) where it was calling the local function even without the namespace defined which was a little weird. As I couldn't find the package which contains the global Arduino analogRead and analogWrite function so I could explicitly refer to them by namespace I decided that I would keep the function names conceptually similar and then change everything in the module to use ProperCasing for the function names.

If anyone knows the package that standard analogRead and analogWrite are in then I'll change this to use the correct namespaces. If not then I may change the functions altogether to something like muxAnalogRead() etc which will keep them a lot more separate....

Great point on using unsigned - will switch that.

Re error handling:

I've been having a think about this - there's no real way (as I see it anyway) to check whether the 4051 is connected - you're essentially manipulating the signal on 3 digital pins and then one Analogue IN or OUT - technically these could all be going elsewhere and you'd end up with some interesting effects...

PinNumbers are coming. Am going to set up some checks and then error handling to deal with it. My plan is to expand this to be able to deal with chained mux/demuxers so you can end up with 16 or 24 etc inputs or outputs - to do this you have to add additional control lines, so I'll need to do some refactoring to deal with this...

Cheers
ajfisher