Sippakorn Saeng-aroon
/
InventorStudio_LCP2
v1.1
main.cpp
- Committer:
- pokpongc
- Date:
- 2019-05-05
- Revision:
- 0:ef2ee7458c37
- Child:
- 1:8e3af9643155
File content as of revision 0:ef2ee7458c37:
#include "mbed.h" #include "QEI.h" Serial pc(USBTX, USBRX); QEI temp_dial(D11, D12, A1, 50, QEI::X4_ENCODING); BusIn joy_bus{D3, D4, D5, D6}; BusIn button_bus{D7, D9}; DigitalIn a(D7),b(D9),c(D3),d(D4),e(D5),f(D6); int main() { pc.baud(115200); long pulse = 0; a.mode(PullDown); b.mode(PullDown); c.mode(PullDown); d.mode(PullDown); e.mode(PullDown); f.mode(PullDown); while(1){ pulse = temp_dial.getPulses()/2; pc.printf("%d \t%d\n",joy_bus.read(), button_bus.read()); } }