Posted on May 17, 2011 at 13:35Something like this works. ax,ay&az are the raw readings from the SPI. Code: double vect = sqrt((ax * ax) + (ay * ay) + (az * az)); /* Only allow updates during gravity between 0.9 and 1.1G */ if((vect > MIN) && (vec...
Posted on May 17, 2011 at 13:32Have you tried to cast the volatiles to normal? double z = atan2((u16)ADCSensorValue[ACC_X],(u16)ADCSensorValue[ACC_X]); or double z = atan2((double)ADCSensorValue[ACC_X],(double)ADCSensorValue[ACC_X]); The step with d...
Posted on May 17, 2011 at 13:26Not sure if ''NVIC_GenerateCoreReset()'' works, at least I never got it working. Now I'm using the IWDG with a short timeout followed by a while(1).
Posted on May 17, 2011 at 13:22Are you referring to the internal sensor? Here's what the manual says about this sensor: Quote:The temperature sensor output voltage changes linearly with temperature. The offset of this line varies from chip to chip d...
Posted on May 17, 2011 at 13:17No pullup needed, and yes, the VBUS must be connected to low impedance high level (some very low R pullup/pulldowns active on this pin :| ) Or you can program the pin as high-driven pushpull.