Craig Evans / Mbed 2 deprecated 1620_App_Board_Shift_Register

Dependencies:   ShiftReg mbed

Files at this revision

API Documentation at this revision

Comitter:
eencae
Date:
Fri Mar 03 15:10:14 2017 +0000
Commit message:
minor formatting

Changed in this revision

ShiftReg.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ShiftReg.lib	Fri Mar 03 15:10:14 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/eencae/code/ShiftReg/#33b34e0ed72c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Mar 03 15:10:14 2017 +0000
@@ -0,0 +1,33 @@
+/* ELEC1620 Application Board Example
+
+Shift Register
+
+(c) Dr Craig A. Evans, University of Leeds, Feb 2017
+
+*/
+
+#include "mbed.h"
+#include "ShiftReg.h"  // include ShiftReg library
+
+ShiftReg shift;  // create ShiftReg object
+
+int main()
+{
+    // values for 0 - 9 in hex
+    int seven_seg_array [] = {
+        0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x67
+    };
+
+    // write 0 to 7-seg to turn it off
+    shift.write(0x00);
+
+    while(1) {
+
+        // loop through the array
+        for(int i = 0; i < 10; i++) {
+            shift.write(seven_seg_array[i]);
+            wait(0.5);
+        }
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Mar 03 15:10:14 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/ef9c61f8c49f
\ No newline at end of file