microchip pic32

I spent the past 3 hours debugging my code that was absolutely fine. So just a quick note for everybody who’s working on pic32’s, if you’re using any math functions you have to include math.h; it is not enough to include the peripheral library (plib.h). The compiler won’t complain but you will get garbage out of your math functions.

And if you’re wondering what I was doing with all that math is just computing the temperature for a thermistor using the Steinhart–Hart equation.