![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Marko_Marinic_0246048959
Dependencies: mbed SeeedShieldBot TextLCD BluetoothSerial
SegDisplay.cpp
- Committer:
- mmarinic
- Date:
- 2021-07-13
- Revision:
- 0:0b3b22a12941
File content as of revision 0:0b3b22a12941:
#include "SegDisplay.h" BusOut Seg(D2,D3,D4,D5,D6,D7,D8,D9); void SegInit(void) { Seg=SegConvert(0); } char SegConvert(char SegValue) { char SegByte=0x00; switch (SegValue) { //DP G F E D C B A case 0 : SegByte = 0x3F; break; // 0 0 1 1 1 1 1 1 binary case 1 : SegByte = 0x06; break; // 0 0 0 0 0 1 1 0 binary case 2 : SegByte = 0x5B; break; // 0 1 0 1 1 0 1 1 binary case 3 : SegByte = 0x4F; break; // 0 1 0 0 1 1 1 1 binary case 4 : SegByte = 0x66; break; // 0 1 1 0 0 1 1 0 binary case 5 : SegByte = 0x6D; break; // 0 1 1 0 1 1 0 1 binary case 6 : SegByte = 0x7D; break; // 0 1 1 1 1 1 0 1 binary case 7 : SegByte = 0x07; break; // 0 0 0 0 0 1 1 1 binary case 8 : SegByte = 0x7F; break; // 0 1 1 1 1 1 1 1 binary case 9 : SegByte = 0x6F; break; // 0 1 1 0 1 1 1 1 binary } return SegByte; }