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.
Diff: BDCSEG.cpp
- Revision:
- 0:aa27a09e44d2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/BDCSEG.cpp Sat Aug 19 21:49:33 2017 +0000
@@ -0,0 +1,90 @@
+#include "BCDSEG.h"
+
+int led[12]={0x001,0x003,0x007,0x00f,0x01f,0x03f,0x07f,0x0ff,0x1ff,0x3ff,0x7ff,0xfff};
+void And::ve(PinName a,PinName b,PinName c,PinName d,PinName e,PinName f,PinName g,PinName h,PinName i,PinName j,PinName k,PinName l)
+{
+
+ a_= a;
+ b_= b;
+ c_= c;
+ d_= d;
+ e_= e;
+ f_= f;
+ g_= g;
+ h_= h;
+ i_= i;
+ j_= j;
+ k_= k;
+ l_= l;
+}
+void And::bcd(float number)
+
+{
+ if (number <= 0.275)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[0];
+ }
+ if (number>0.275&&number<=0.275*2)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[1];
+ }
+ if (number>0.275*2&&number<=0.275*3)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[2];
+ }
+ if (number>0.275*3&&number<=0.275*4)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[3];
+ }
+ if (number>0.275*4&&number<=0.275*5)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[4];
+ }
+ if (number>0.275*5&&number<=0.275*6)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[5];
+ }
+ if (number>0.275*6&&number<=0.275*7)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[6];
+ }
+ if (number>0.275*7&&number<=0.275*8)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[7];
+ }
+ if (number>0.275*8&&number<=0.275*9)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[8];
+ }
+ if (number>0.275*9&&number<=0.275*10)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[9];
+ }
+ if (number>0.275*10&&number<=0.275*11)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[10];
+ }
+ if (number>0.275*11&&number<=0.275*12)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[11];
+ }
+ if (number>0.275*12)
+ {
+ BusOut Leds(D13,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12);
+ Leds=led[12];
+ }
+
+
+}
\ No newline at end of file