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.
main.cpp
00001 #include "mbed.h" 00002 DigitalIn button(D4); 00003 BusOut seg(D7,D8,D9,D10,D11,D12,D13); 00004 00005 char SegConvert(char SegValue); 00006 00007 int main() { 00008 while(1) { 00009 for (char i=0;i<10; button==1&&i++) 00010 { 00011 seg=SegConvert(i); 00012 wait(1); 00013 } 00014 } 00015 } 00016 00017 char SegConvert(char SegValue){ 00018 char SegByte=0x00; 00019 switch(SegValue) { 00020 case 0 : SegByte = 16;break; 00021 case 1 : SegByte = 0;break; 00022 case 2 : SegByte = 120;break; 00023 case 3 : SegByte = 2;break; 00024 case 4 : SegByte = 18;break; 00025 case 5 : SegByte = 25;break; 00026 case 6 : SegByte = 48;break; 00027 case 7 : SegByte = 36;break; 00028 case 8 : SegByte = 121;break; 00029 case 9 : SegByte = 64;break; 00030 } 00031 return SegByte; 00032 }
Generated on Fri Sep 23 2022 06:45:48 by
1.7.2