View Single Post
  #1   Spotlight this post!  
Unread 11-07-2005, 14:35
ImmortalAres ImmortalAres is offline
Registered User
no team
 
Join Date: May 2005
Location: Clarkson University
Posts: 33
ImmortalAres is an unknown quantity at this point
integer division

the following is part of kevins accelerometer code


Code:
 
#include "p18f452.h"
#include "accel.h"

unsigned int X_Axis_Total_Period = 2/1000; // x-axis total cycle time (T2 in the data sheet)
unsigned int X_Axis_Pulse_Period = 0; // x-axis amount of time the pulse is high (T1 in the data sheet)
unsigned int Y_Axis_Total_Period = 2/1000; // y-axis total cycle time (T2 in the data sheet)
unsigned int Y_Axis_Pulse_Period = 0; // y-axis amount of time the pulse is high (T1 in the data sheet)

my debugger says it loops in a file called 16 bit integer division leading me to think that it hangs on the 2/1000 definition of t2

any ideas?