Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SegDisplay.cpp
00001 #include "mbed.h" 00002 #include "SegDisplay.h" 00003 00004 BusOut Seg1(p5,p6,p7,p8,p9,p10,p11,p12); // A,B,C,D,E,F,G,DP 00005 BusOut Seg2(p13,p14,p15,p16,p17,p18,p19,p20); // A,B,C,D,E,F,G,DP 00006 00007 void SegInit(void){ 00008 Seg1 = SegConvert(0); 00009 Seg2 = SegConvert(0); 00010 } 00011 char SegConvert(char SegValue){ 00012 char SegByte=0x00; 00013 switch (SegValue){ 00014 case 0 : SegByte = 0x3F;break; 00015 case 1 : SegByte = 0x06;break; 00016 case 2 : SegByte = 0x5B;break; 00017 case 3 : SegByte = 0x4F;break; 00018 case 4 : SegByte = 0x66;break; 00019 case 5 : SegByte = 0x6D;break; 00020 case 6 : SegByte = 0x7D;break; 00021 case 7 : SegByte = 0x07;break; 00022 case 8 : SegByte = 0x7F;break; 00023 case 9 : SegByte = 0x6F;break; 00024 case 10: SegByte = 0x77;break; 00025 case 11: SegByte = 0x7C;break; 00026 case 12: SegByte = 0x39;break; 00027 case 13: SegByte = 0x5E;break; 00028 case 14: SegByte = 0x79;break; 00029 case 15: SegByte = 0x71;break; 00030 } 00031 return SegByte; 00032 }
Generated on Fri Jul 15 2022 03:02:01 by
1.7.2