main.c
/**
* 工程名称:温度记录仪
* Mode 0: 温度采集间隔选择模式,用以确定温度采集间隔
* Mode 1: 采集并显示实时时间,采集温度并缓存
* Mode 2: 查看采集到的10个温度样本
*
*
*/
#include <stc15f2k60s2.h>
#include "stdint.h"
#include "timer.h"
#include "digitalTube.h"
#include "independentKey.h"
#include "DS18B20.h"
#include "DS1302.h"
uint8_t mode = 0; //工作模式
uint8_t code collectingPeriod[4] = { 1, 10, 30, 60 }; //温度采集间隔
uint8_t periodIndex = 0; //温度采集间隔选择索引
//bit realTimeLock = 1, temperatureLock = 1; //采集温度和实时时间的锁变量
int16_t temperature; //采集到的温度
uint8_t temperIntBuf[10]; //采集到的温度的整数部分缓冲
uint8_t temperIndex = 0, temperLookingIndex = 0;
bit flag200ms = 0, flagTemper = 0; //200ms采集一次RTC,采集