I found an issue with tuneCap() and the mask used to set the AS3935 bits in register 0x08. If I edit Example 3 and change the code to set tuneCap to a value of 2 (for 16pf). When the code reads the value back with readTuneCape() it reports 88pf instead of 16. I traced the issue back to an incorrect value of the CAP_MASK in Sparkfun_AS3935.h. The value should be 0x0F, not 0xF0 to match the register map in the data sheet. Also I found a small error, in the readTuneCap() where the value read was anded with Not value of the mask, instead of the value of the mask. I will create a pull request with my changes. I have fixed these two error in my fork and tested them, and the code now works as expected.
I found an issue with tuneCap() and the mask used to set the AS3935 bits in register 0x08. If I edit Example 3 and change the code to set tuneCap to a value of 2 (for 16pf). When the code reads the value back with readTuneCape() it reports 88pf instead of 16. I traced the issue back to an incorrect value of the CAP_MASK in Sparkfun_AS3935.h. The value should be 0x0F, not 0xF0 to match the register map in the data sheet. Also I found a small error, in the readTuneCap() where the value read was anded with Not value of the mask, instead of the value of the mask. I will create a pull request with my changes. I have fixed these two error in my fork and tested them, and the code now works as expected.