Sippakorn Saeng-aroon
/
InventorStudio_LCP2
v1.1
Diff: main.cpp
- Revision:
- 0:ef2ee7458c37
- Child:
- 1:8e3af9643155
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun May 05 10:14:52 2019 +0000 @@ -0,0 +1,28 @@ +#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()); + + + } +} +