Motor Shield Example code for 2.74 Class @ MIT
Dependents: experiment_example motor_shield_example Lab3_experiment_example jumping_leg_clicky
Diff: MotorShield.cpp
- Revision:
- 7:e3a2ade56b79
- Parent:
- 5:d2dffc88e94d
- Child:
- 8:46feb6919761
--- a/MotorShield.cpp Wed Aug 26 19:35:02 2020 +0000 +++ b/MotorShield.cpp Wed Aug 26 23:42:07 2020 +0000 @@ -77,6 +77,19 @@ } } +uint32_t MotorShield::readCurrentA() { + return readADC1(0); +} +uint32_t MotorShield::readCurrentB() { + return readADC1(1); +} +uint32_t MotorShield::readCurrentC() { + return readADC2(1); +} +uint32_t MotorShield::readCurrentD() { + return readADC2(0); +} + void MotorShield::changePeriod(int periodTicks){ periodTickVal = periodTicks; init();