ledx7.h

来自「msp430的C++数码管完美驱动 用msp430F247成功测试」· C头文件 代码 · 共 42 行

H
42
字号

#ifndef _SHORT
#define _SHORT
#define uchar unsigned char
#define uint  unsigned int
#endif  //endif _SHORT 

#define  Latch_addr_H    P5OUT|=0x10
#define  Latch_addr_L    P5OUT&=0xef
#define  Latch_data_H    P5OUT|=0x20
#define  Latch_data_L    P5OUT&=0xdf

#ifndef _DELAY
#define _DELAY
void Delay(uint tc)
{
  while(tc--);
}
#endif  //endif _DELAY

 class Ledx7
{
public:
  Ledx7();
  void Display(uchar pos,uchar value); 
//  void Display(uint value);
  void Display(float value);
  void Test();
  void Clear();
  uint GetDlTime() { return DlTime; };
  void Setvalue(float Ntemp);
  void SetPnPos(uchar NewPos);
  bool GetHL(){return HiLeft;};
  void SetHL(bool NewB);
private:
  uchar Number[13];
  uchar value[4];
  uint DlTime;
  uchar PnPos;
  bool HiLeft;
  bool KasUnit;
};

⌨️ 快捷键说明

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