资源简介
msp430f5529 闹钟程序
![](http://www.nz998.com/pic/62990.jpg)
代码片段和文件信息
#include
#include
#include “msp430.h“
#include “HAL_Dogs102x6.h“
void lcd_int(void);
void time_1_int(void);
void display_time(void);
void display_style(void);
void button_init(void);
void key_scan(void);
void clock_check(void);
void display_ADC(void);
void ADC_init(void);
uint16_t get_temp_Value(void);
uint16_t get_ADC_voltage_Value(void);
char hour=0min=0sec=0;
char clk_hour=0clk_min=0clk_sec=20;
char key_chose=5;
unsigned int time_counter=0;
unsigned int ADC_voltage=0;
unsigned int tempDataADC_voltageDataOld;
unsigned int tempDataOldADC_voltageData;
volatile long IntDegF;
volatile long IntDegC;
volatile long temp;
uint8_t time_hour_style=0;
uint8_t time_min_style=0;
uint8_t clk_hour_style=0;
uint8_t clk_min_style=0;
uint8_t clk_sec_style=0;
char time[] =“time :00-00-00“;
char clock[]=“clock:00-00-00“;
char time_hour[]=“00“;
char time_min[]=“00“;
char time_sec[]=“00“;
char clock_disp_hour[]=“00“;
char clock_disp_min[]=“00“;
char clock_disp_sec[]=“00“;
char temp1[]=“AD_IntDegF=0000“;
char temp2[]=“AD_IntDegC=0000“;
char adc_volage[]=“ADC_votage=0000“;
const uint8_t clock_disp[]={0x200x02
0x000x1F0x800x440x040x440x540x4F0x440x440x440x440x400x7F0x000x00
0x040x080x340xE70x240x240x000x0F0x080x080xFF0x080x080x0F0x000x00
0x000xFF0x000x000xF80x800x800xFE0x900x880xF00x020x010xFE0x000x00
0x800x800x800xFE0x840x880x000xE00x400x400xFF0x400x400xE00x000x00
}; //display“naozhong“
void main( void )
{
WDTCTL = WDTPW + WDTHOLD;
time_1_int();
lcd_int();
button_init();
Dogs102x6_imageDraw(clock_disp035);
Dogs102x6_stringDraw(20timeDOGS102x6_DRAW_NORMAL); // write data to LCD
Dogs102x6_stringDraw(30clockDOGS102x6_DRAW_NORMAL); // write data to LCD
ADC_init();
P1DIR |= (0x01<<0);
P8DIR |= (0x01<<2);
while(1)
{
ADC12CTL0 |= ADC12SC;
display_ADC();
display_time();
key_scan();
clock_check();
}
}
uint16_t get_temp_Value(void)
{
if (tempData > tempDataOld)
if ((tempData - tempDataOld) > 10)
tempDataOld = tempData; //use new data if change is beyond
// fluctuation threshold
else
tempData = tempDataOld; //use old data if change is not beyond
// fluctuation threshold
else
if ((tempDataOld - tempData) > 10)
tempDataOld = tempData; //use new data if change is beyond
// fluctuation threshold
else
tempData = tempDataOld; //use old data if change is not beyond
// fluctuation threshold
return tempData;
}
uint16_t get_ADC_voltage_Value(void)
{
if (ADC_voltageData > ADC_voltageDataOld)
if ((ADC_voltageData - ADC_voltageDataOld) > 10)
ADC_voltageDataOld = ADC_voltageData; //use new data if change is beyo
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 11783 2013-05-28 15:31 main.c
----------- --------- ---------- ----- ----
11783 1
相关资源
- MSP430F5529移植modbus
- MSP430F5529 例程源码
- 基于MSP430F5529的智能无线遥控小车设计
- msp430f5529学习资料
- MSP430 F5529 LaunchPad完整资料内含例程代
- TI的msp430f5529读取夏普灰尘传感器,并
- 基于MSP430F5529的步进电机驱动程序
- msp430f5529IAR.rar
- MSP430F5529经典例程
- msp430f5529sd卡读取程序
- MSP430F5529的实验程序(包含了所有的库
- msp430f5529口袋板
- 基于MSP430F5529的掌上游戏机
- MSP430F5529_25Hz方波发生及测量实验.do
- MSP430f5529中文手册.pdf
- 2018电赛 手势识别for MSP430F5529 oled图形
- MSP430F5529中文指导
- MSP430F5529LP的资料及程序
- MSP430F5529 官方代码例程库
- MSP430f5529官方例程全面.zip
- MSP430F5529的官方例程
- FDC2214例程读取电容值msp430f5529
- MSP430课程设计之DS18B20、DHT11、0.96寸
- ADS1118的MSP430F5529驱动程序
- MSP430F5529LP延时函数.rar
- 基于MSP430F5529单片机的蓝牙遥控小车
- msp430 DS18B20.rar
- msp430f5529定时器A程序
- msp430f5529仿真部分的呼吸灯
- msp430F5529的TI官方程序,IAR程序
评论
共有 条评论