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.
Fork of motor_calibration by
Revision 10:4d5af6e84c7a, committed 2018-10-31
- Comitter:
- s1725696
- Date:
- Wed Oct 31 18:36:38 2018 +0000
- Parent:
- 9:6672bbf14f7a
- Commit message:
- nvm, last version it is
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Oct 31 18:25:31 2018 +0000
+++ b/main.cpp Wed Oct 31 18:36:38 2018 +0000
@@ -5,9 +5,9 @@
/* THIS IS IMPLEMENTED IN THE BIG CODE, DO NOT CHANGE IT HERE, BUT THERE!!! */
//initial allocations
-DigitalOut dirpin(D4); // for translatie
+DigitalOut dirpin_1(D4); // for translatie
DigitalOut dirpin_2(D7); // for rotatie
-PwmOut pwmpin(D5);
+PwmOut pwmpin_1(D5);
PwmOut pwmpin_2(D6);
QEI Encoder1(D12,D13,NC,64,QEI::X4_ENCODING);
QEI Encoder2(D10,D11,NC,64,QEI::X4_ENCODING);
@@ -30,7 +30,7 @@
float speed = 0.70;
int dir = 0;
-// Functions (2 functions not finished)
+// Functions
int Counts1(volatile int& a) // a = counts1
{
counts1_prev = a;
@@ -61,14 +61,14 @@
// Start translation
void translation_start(int a, float b) // a = dir , b = speed
{
- dirpin.write(a);
- pwmpin = b;
+ dirpin_1.write(a);
+ pwmpin_1 = b;
}
// Stop translation
void translation_stop()
{
- pwmpin = 0.0;
+ pwmpin_1 = 0.0;
}
// Start rotation
