Test program for LS7366 expansion board for the WSE SBC for quad encoder interfaces. Uses the LS7366LIB device class.
main.cpp
00001 // Test program for WSE-PROJ-SBC encoder expander board 00002 // J Bradshaw 2014-12-10 00003 #include "mbed.h" 00004 #include "LS7366.h" 00005 00006 SPI spi(p5, p6, p7); 00007 LS7366 enc1(spi, p19); 00008 LS7366 enc2(spi, p20); 00009 LS7366 enc3(spi, p28); 00010 LS7366 enc4(spi, p27); 00011 Serial pc(USBTX, USBRX); // tx, rx for serial USB interface to pc 00012 00013 //------------------- MAIN -------------------------------- 00014 int main() 00015 { 00016 while(1){ 00017 pc.printf("enc1 = %ld enc2 = %ld enc3 = %ld enc4 = %ld\r\n",enc1.read(), enc2.read(),enc3.read(), enc4.read()); 00018 wait(.02); 00019 }//while(1) 00020 }//main
Generated on Sat Jul 30 2022 09:58:58 by 1.7.2