main.c

来自「基于MSP430的AD转换」· C语言 代码 · 共 51 行

C
51
字号
#ifndef MSP430F449_H
#include <msp430x44x.h>
#endif


int m_a0;
int m_a1;
int m_max; 
int m_flag;
#define m_LowLimit   1000
#define m_HighLimit  2000


#include "ad.h"
#include "timer.h"

#include "led.h"


void main(void)
{
  
  WDTCTL = WDTHOLD + WDTPW;
   
  Init_AD();
  Init_TimerB();
  init_LED();
   
  m_a0=0;
  m_a1=0;
  
  _EINT();
  
  
  int temp1;
  int temp2;
  
  while(1)
  {
    led_Buf[0] = m_max/1000;
    temp1 = m_max%1000 ;
    led_Buf[1] = temp1/100;
    temp2 =temp1 % 100;
    led_Buf[2]=temp2/10;
    temp1=temp2%10 ;
    led_Buf[3]=temp1; 
    led_Buf[4]=m_flag; 
    led_Display();
   } 
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?