A substantial overhaul of the Cave Pearl codebase

Driving all the new sensors that have been added over the last few weeks produced a real “herd of cats” in the codebase.  So I spent some time doing a major update of the Cave Pearl software, which is now posted at the project github. There are too many changes to list here, but a few highlights are that I2C register functions have been extracted to common subroutines and I have wrapped large sections with #ifdef/#endif statements, to make the sketch to adapt automatically to whatever combination of different sensors is attached for a given deployment  (drawing on the techniques used for the multiwii project) . I also have an scheme to replace power wasting delays (while waiting for high bit depth sensor conversions) with variable watchdog timer sleeps.

And just as a teaser, there have also been some dramatic new developments on the hardware side of things. Some of you will see that telegraphed here, but I am not tipping my hat on that till the bench-top tests give me more preliminary numbers. It will be interesting to see if anyone can spot what my next post will be about from the code alone… 🙂