I have a device setup to retrieve information from varies sensors.
double PCBTemp = 0, AcColdTemp = 0, AcHeatTemp = 0, mainLEDTemp = 0, frontLEDTemp = 0, rearLEDTemp = 0; int ac_status = 0; int pump_spd = 0;
They are being updated once every 2 seconds.
Upon creating a lot of variables with many different types(approximately 100+ variables), without any function modifying a variable such as “pump_spd”. When printing, the variable “pump_spd” would display the initial value 0. Without a repeatable pattern, it would suddenly display a value such as 93765147083248.29 when I am debugging using
printf("pump_spd: %d", pump_spd);
Then the photon would flash the red SOS for HARD FAULT.
Will appreciate if anyone could think of the possible reason why this would occur!