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:
- 0:e512ee8d297b
- Child:
- 1:6f02ee58c5d6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Sep 02 06:32:03 2016 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+
+DigitalOut datapin(D8);
+DigitalOut latchpin(D9);
+DigitalOut clockpin(D10);
+DigitalOut xx(D11);
+
+int main() {
+const int number[10][7]= {
+ { 0, 0, 0, 0, 1, 1, 0}, // 1
+ { 1, 0, 1, 1, 0, 1, 1}, // 2
+ { 1, 0, 0, 1, 1, 1, 1}, // 3
+ { 1, 1, 0, 0, 1, 1, 0}, // 4
+ { 1, 1, 0, 1, 1, 0, 1}, // 5
+ { 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
+};
+ while(1)
+ {
+ for(int j=0;j<=9;j++)
+ {
+ latchpin=0;
+ for(int i=0;i<=7;i++)
+ {
+ wait(0.125);
+ datapin=number[j][i];
+ clockpin=1;
+ clockpin=0;
+ }
+ latchpin=1;
+ }
+
+ }
+}