motorcontroll/myinc/tm1650.h
2023-03-23 17:00:05 +08:00

31 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef TM1650_H_
#define TM1650_H_
#include "config.h"
// 显示参数
#define TM1650_BRIGHT1 0x11 /*一级亮度打开LED显示*/
#define TM1650_BRIGHT2 0x21 /*二级亮度打开LED显示*/
#define TM1650_BRIGHT3 0x31 /*三级亮度打开LED显示*/
#define TM1650_BRIGHT4 0x41 /*四级亮度打开LED显示*/
#define TM1650_BRIGHT5 0x51 /*五级亮度打开LED显示*/
#define TM1650_BRIGHT6 0x61 /*六级亮度打开LED显示*/
#define TM1650_BRIGHT7 0x71 /*七级亮度打开LED显示*/
#define TM1650_BRIGHT8 0x01 /*八级亮度打开LED显示*/
#define TM1650_DSP_OFF 0x00 /*关闭LED显示*/
// 数码管位选
#define TM1650_DIG1 0
#define TM1650_DIG2 1
#define TM1650_DIG3 2
#define TM1650_DIG4 3
#define sda P33
#define scl P32
void TM1650_init(void); // 初始化
void TM1650_print(unsigned char dig, unsigned char seg_data);
void TM1650_printpogrun(u8 set,u8 mode);// 显示----页面0显示
void TM1650_printpogstop(u8 set);// 显示----页面0显示
void TM1650_print_SMG1(u8 set);
void TM1650_print_SMG2(u16 set);
void TM1650_print_SMG3(u8 set) ;
#endif