Thread: I hate "C"
View Single Post
  #6   Spotlight this post!  
Unread 20-01-2007, 00:38
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: I hate "C"

Matt,

There is a lot of your declarations not shown (such as your pid structure) but I'm guessing your issue is with the printf statement. "measurement" is declared as a long at the top of your function and being passed to printf as a long but printf is expecting an int. It should be cast as "(int) measurement". This would throw off all of your stack variables by two bytes each.

Output may be non-zero but I doubt it is correct.

Good Luck...

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...