da

Dependencies:   mbed TrapezoidControl QEI

Committer:
yabahiro
Date:
Sun Sep 15 11:53:56 2019 +0000
Revision:
23:694ecfa97839
Parent:
16:3f2c2d89372b
ewf

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kishibekairohan 16:3f2c2d89372b 1 #include "Encoder.h"
7ka884 1:b1219d8ca117 2 #include "mbed.h"
7ka884 1:b1219d8ca117 3
7ka884 1:b1219d8ca117 4 #include "../../System/Process/InterruptProcess.h"
7ka884 1:b1219d8ca117 5
kishibekairohan 16:3f2c2d89372b 6 InterruptIn BoardECD[] = {
kishibekairohan 16:3f2c2d89372b 7 InterruptIn(ECD_A_0),
kishibekairohan 16:3f2c2d89372b 8 InterruptIn(ECD_A_1),
kishibekairohan 16:3f2c2d89372b 9 InterruptIn(ECD_A_2),
kishibekairohan 16:3f2c2d89372b 10 InterruptIn(ECD_A_3),
7ka884 1:b1219d8ca117 11
kishibekairohan 16:3f2c2d89372b 12 InterruptIn(ECD_B_0),
kishibekairohan 16:3f2c2d89372b 13 InterruptIn(ECD_B_1),
kishibekairohan 16:3f2c2d89372b 14 InterruptIn(ECD_B_2),
kishibekairohan 16:3f2c2d89372b 15 InterruptIn(ECD_B_3),
7ka884 1:b1219d8ca117 16 };
7ka884 1:b1219d8ca117 17
kishibekairohan 16:3f2c2d89372b 18 namespace ENCODER {
kishibekairohan 16:3f2c2d89372b 19 void ECD::Initialize() {
kishibekairohan 16:3f2c2d89372b 20 BoardECD[0].mode(PullUp);
kishibekairohan 16:3f2c2d89372b 21 BoardECD[1].mode(PullUp);
kishibekairohan 16:3f2c2d89372b 22 BoardECD[2].mode(PullUp);
kishibekairohan 16:3f2c2d89372b 23 BoardECD[3].mode(PullUp);
7ka884 1:b1219d8ca117 24
kishibekairohan 16:3f2c2d89372b 25 BoardECD[0].fall(int2);
kishibekairohan 16:3f2c2d89372b 26 BoardECD[1].fall(int3);
kishibekairohan 16:3f2c2d89372b 27 BoardECD[2].fall(int4);
kishibekairohan 16:3f2c2d89372b 28 BoardECD[3].fall(int5);
7ka884 1:b1219d8ca117 29 }
7ka884 1:b1219d8ca117 30 }