View Single Post
  #62  
Old 24-01-2013, 09:02 AM
DancesWithWords
Registered User

DancesWithWords is offline
 
Join Date: Jul 2011
Location: Ottawa, CanadaO
Posts: 9
Quote:
Originally Posted by rcheshire View Post
Not sure if this is helpful? if you are using, data types unsigned int; or unsigned long; they don't store negative numbers... int; and long; do.

-32! Ouch. I remember -20C with a wind chill of -35 in Goose Bay one time. Best to stay indoors.
Looking at the code it looks like Sungjune used 32bit unsigned type.

// note that all the time variable should be 32bit unsigned.
static uint32_t system_tick = 0; // ever increasing from zero
static uint32_t slcd_timer = 0; // timeout count for the LCD backlight
static uint32_t encsw_timer = 0; // timeout count for the encoder switch

// this value is used to determine the heater control
#define DEWPOINT_MARGIN 500 // 5 degree in celsius

static int16_t dew_point = -1000; // initial value(-10 degree)
static int16_t ambient_temp = 0; // ambient temp. in Celcius (x100)
static int16_t ambient_humid = 0; // relative humidity in percentage
static int16_t mirror_temp = 0; // mirror temp. in Celcius (x100)

===
DWW
Reply With Quote