Test program for LS7366 expansion board for the WSE SBC for quad encoder interfaces. Uses the LS7366LIB device class.

Dependencies:   LS7366LIB mbed

/media/uploads/jebradshaw/encoderexpansionboard.jpg mbed WSE SBC LS7366 quadrature encoder interface expansion board using the LS7366LIB library

This printed circuit board connects 2 LS7366 SPI encoder interface IC's to the mbed WSE SBC. The LS7366LIB library allows the user to instantiate encoder objects with chip selects on p27 and p28 to expand the two encoder interfaces on the WSE SBC to 4.

/media/uploads/jebradshaw/encexp_wse_sbc.jpg

Files at this revision

API Documentation at this revision

Comitter:
jebradshaw
Date:
Wed Dec 10 13:53:41 2014 +0000
Commit message:
mbed WSE SBC encoder expansion board using LS7366LIB device class

Changed in this revision

LS7366LIB.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/LS7366LIB.lib	Wed Dec 10 13:53:41 2014 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/jebradshaw/code/LS7366LIB/#c2458154721b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Dec 10 13:53:41 2014 +0000
@@ -0,0 +1,20 @@
+// Test program for WSE-PROJ-SBC encoder expander board
+// J Bradshaw 2014-12-10
+#include "mbed.h"
+#include "LS7366.h"
+
+SPI spi(p5, p6, p7);   
+LS7366 enc1(spi, p19);
+LS7366 enc2(spi, p20);
+LS7366 enc3(spi, p28);
+LS7366 enc4(spi, p27);
+Serial pc(USBTX, USBRX); // tx, rx for serial USB interface to pc
+
+//------------------- MAIN --------------------------------
+int main()
+{    
+    while(1){ 
+        pc.printf("enc1 = %ld enc2 = %ld enc3 = %ld enc4 = %ld\r\n",enc1.read(), enc2.read(),enc3.read(), enc4.read());
+        wait(.02);
+    }//while(1)                        
+}//main
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Dec 10 13:53:41 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file