YX ZHANG
/
NiXie
hello Nixie
Fork of NiXie by
Nixie/Nixie.h@0:b5bd2bc3c14d, 2017-06-16 (annotated)
- Committer:
- heroistired
- Date:
- Fri Jun 16 07:07:15 2017 +0000
- Revision:
- 0:b5bd2bc3c14d
- Child:
- 1:ad106a887eb8
Chen Huan; EEA of THU
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
heroistired | 0:b5bd2bc3c14d | 1 | #ifndef __NIXIE_H |
heroistired | 0:b5bd2bc3c14d | 2 | #define __NIXIE_H |
heroistired | 0:b5bd2bc3c14d | 3 | |
heroistired | 0:b5bd2bc3c14d | 4 | /*************************************************************** |
heroistired | 0:b5bd2bc3c14d | 5 | 功能 : mbed的串联74HC595数码管驱动 |
heroistired | 0:b5bd2bc3c14d | 6 | 作者 : 陈欢 清华大学电机工程与应用电子技术系 |
heroistired | 0:b5bd2bc3c14d | 7 | 邮箱 : h-che14@mails.tsinghua.edu.cn OR heroistired@gmail.com |
heroistired | 0:b5bd2bc3c14d | 8 | 声明 : |
heroistired | 0:b5bd2bc3c14d | 9 | 本程序仅供学习与交流使用,如需他用,须联系作者 |
heroistired | 0:b5bd2bc3c14d | 10 | 本程序可以随意更改,但须保留本信息页 |
heroistired | 0:b5bd2bc3c14d | 11 | All rights reserved |
heroistired | 0:b5bd2bc3c14d | 12 | 2017.6.16 |
heroistired | 0:b5bd2bc3c14d | 13 | ***************************************************************/ |
heroistired | 0:b5bd2bc3c14d | 14 | |
heroistired | 0:b5bd2bc3c14d | 15 | #include "mbed.h" |
heroistired | 0:b5bd2bc3c14d | 16 | |
heroistired | 0:b5bd2bc3c14d | 17 | const char NumCode[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; |
heroistired | 0:b5bd2bc3c14d | 18 | const char SegBit[]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01}; |
heroistired | 0:b5bd2bc3c14d | 19 | |
heroistired | 0:b5bd2bc3c14d | 20 | //数码管类 |
heroistired | 0:b5bd2bc3c14d | 21 | class Nixie |
heroistired | 0:b5bd2bc3c14d | 22 | { |
heroistired | 0:b5bd2bc3c14d | 23 | public: |
heroistired | 0:b5bd2bc3c14d | 24 | Nixie(PinName _DIO, PinName _SCK, PinName _RCK); |
heroistired | 0:b5bd2bc3c14d | 25 | void NixieShow(int Num, int Pos, bool WithDot); |
heroistired | 0:b5bd2bc3c14d | 26 | |
heroistired | 0:b5bd2bc3c14d | 27 | protected: |
heroistired | 0:b5bd2bc3c14d | 28 | DigitalOut DIO; |
heroistired | 0:b5bd2bc3c14d | 29 | DigitalOut SCK; |
heroistired | 0:b5bd2bc3c14d | 30 | DigitalOut RCK; |
heroistired | 0:b5bd2bc3c14d | 31 | }; |
heroistired | 0:b5bd2bc3c14d | 32 | #endif |