Quantcast
Channel: Cypress Semiconductor - PSoC 5 Known Problems and Solutions
Viewing all articles
Browse latest Browse all 264

PSoC calculation returns nan(0x8000000000000). What means nan? pleas Help me

$
0
0

#include <project.h>
#include <ADXL345.h>
#include "math.h"

int main()
{
    int  st_speed=30; // m/s
     int x_axis = 10; // in  meter
    
    float g = 9.807; // in  m/s^2
   

void ADXL_Init();
    CyGlobalIntEnable; /* Enable global interrupts. */
  I2C_ADXL_Start(); 

 

calc_Angle_x = (1/2*asin(x_axis*g/st_speed*st_speed))*((180.0)/3.14);

for(;;)
    {   

why does calc_Angle_x return nan(0x8000000000000)and what nan means?

It supposed to return 3.129462438 degree

Attachments: 

Viewing all articles
Browse latest Browse all 264

Trending Articles