Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: experiment_example motor_shield_example Position_ctrl Lab3_experiment_example ... more
Diff: MotorShield.cpp
- Revision:
- 7:e3a2ade56b79
- Parent:
- 5:d2dffc88e94d
--- 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();