I'm on my first project, it's a light-level triggered camera flash trigger. I am using a TSL230 so I have to deal with frequencies for everything. It's pretty much working the way I want it to, but I have constantly run into math issues. I have a background with programming and signal processing but never at the micro-controller level. I've noticed that the arduino is really sensitive to how an equation is entered. it seems like if part of the equation goes out of the bounds of the result type, the result ends up being overloaded. For example the result type below is an unsigned integer so while the equations are equivalent the first ends up with a bogus result. Is there a resource that explains how arduino processes equations so I can understand exactly what is going on?
def_thresh = avg_f + (min_f-avg_f)*1.1; def_thresh = avg_f - (avg_f-min_f)*1.1;