lib de ugokasu
lib.cpp@0:25ffb1df8a87, 2021-03-04 (annotated)
- Committer:
- THtakahiro702286
- Date:
- Thu Mar 04 09:48:23 2021 +0000
- Revision:
- 0:25ffb1df8a87
lib de ugokasu
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
THtakahiro702286 | 0:25ffb1df8a87 | 1 | #include "lib.h" |
THtakahiro702286 | 0:25ffb1df8a87 | 2 | |
THtakahiro702286 | 0:25ffb1df8a87 | 3 | Lib::Lib() |
THtakahiro702286 | 0:25ffb1df8a87 | 4 | { |
THtakahiro702286 | 0:25ffb1df8a87 | 5 | md[0] = new KohiMD(PA_15); |
THtakahiro702286 | 0:25ffb1df8a87 | 6 | md[1] = new KohiMD(PA_6); |
THtakahiro702286 | 0:25ffb1df8a87 | 7 | md[2] = new KohiMD(PA_7); |
THtakahiro702286 | 0:25ffb1df8a87 | 8 | md[3] = new KohiMD(PB_6); |
THtakahiro702286 | 0:25ffb1df8a87 | 9 | } |
THtakahiro702286 | 0:25ffb1df8a87 | 10 | |
THtakahiro702286 | 0:25ffb1df8a87 | 11 | void Lib::go(double pwm) |
THtakahiro702286 | 0:25ffb1df8a87 | 12 | { |
THtakahiro702286 | 0:25ffb1df8a87 | 13 | for(int i=0; i < 4; i++) md[i]->setSpeed(pwm); |
THtakahiro702286 | 0:25ffb1df8a87 | 14 | } |