Preliminary mbed encoder interface IC class

Dependents:   mbed_QUAD_ENCLIB_TEST Axis Axis_20181108 Axis_version2

include the mbed library with this snippet

#include "mbed.h"
#include "LS7366.h"

SPI spi(p5, p6, p7);   
LS7366 enc1(spi, p19);
LS7366 enc2(spi, p20);
Serial pc(USBTX, USBRX); // tx, rx for serial USB interface to pc

//------------------- MAIN --------------------------------
int main()
{    
    while(1){ 
        pc.printf("enc1 = %ld enc2 = %ld\r\n",enc1.read(), enc2.read());
        wait(.02);
    }//while(1)                        
}//main
Download repository: zip gz

Files at revision 2:2193b220248b

Name Size Actions
[up]
LS7366.cpp 4357 Revisions Annotate
LS7366.h 3025 Revisions Annotate