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: main.cpp
- Revision:
- 1:6f02ee58c5d6
- Parent:
- 0:e512ee8d297b
diff -r e512ee8d297b -r 6f02ee58c5d6 main.cpp
--- a/main.cpp Fri Sep 02 06:32:03 2016 +0000
+++ b/main.cpp Sun Sep 04 07:56:19 2016 +0000
@@ -3,10 +3,10 @@
DigitalOut datapin(D8);
DigitalOut latchpin(D9);
DigitalOut clockpin(D10);
-DigitalOut xx(D11);
int main() {
-const int number[10][7]= {
+const int number[10][8]= {
+ { 0, 1, 1, 1, 1, 1, 1}, // 0
{ 0, 0, 0, 0, 1, 1, 0}, // 1
{ 1, 0, 1, 1, 0, 1, 1}, // 2
{ 1, 0, 0, 1, 1, 1, 1}, // 3
@@ -15,23 +15,26 @@
{ 1, 1, 1, 1, 1, 0, 0}, // 6
{ 0, 0, 0, 0, 1, 1, 1}, // 7
{ 1, 1, 1, 1, 1, 1, 1}, // 8
- { 1, 1, 0, 0, 1, 1, 1}, // 9
- { 0, 1, 1, 1, 1, 1, 1} // 0
+ { 1, 1, 0, 0, 1, 1, 1} // 9
+
};
while(1)
- {
+
+ {
for(int j=0;j<=9;j++)
{
- latchpin=0;
+ latchpin=0;
+
for(int i=0;i<=7;i++)
{
- wait(0.125);
datapin=number[j][i];
clockpin=1;
clockpin=0;
}
- latchpin=1;
- }
+ latchpin=1;
+ wait(0.5);
+ }
+
}
}