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
Diff: LS7366.cpp
- Revision:
- 1:c627734cf04c
- Parent:
- 0:c2458154721b
- Child:
- 2:2193b220248b
--- a/LS7366.cpp Tue Dec 09 19:08:46 2014 +0000 +++ b/LS7366.cpp Mon Aug 31 17:13:34 2015 +0000 @@ -161,10 +161,6 @@ return *this; } -LS7366& LS7366::operator= (LS7366& rhs) { - write(rhs.read()); - return *this; -} LS7366::operator long() { return read();