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

main.cpp

Committer:
jebradshaw
Date:
2014-12-10
Revision:
0:58fb3f040295

File content as of revision 0:58fb3f040295:

// 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