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.
Dependencies: mbed mbed-rtos TextLCD
Diff: STEPPER_MOTOR.cpp
- Revision:
- 16:9f98ec0ededb
- Parent:
- 14:63998be3d43c
--- a/STEPPER_MOTOR.cpp Mon Feb 11 20:43:39 2019 +0000
+++ b/STEPPER_MOTOR.cpp Mon Feb 11 22:03:47 2019 +0000
@@ -9,7 +9,10 @@
}
STEPPER_MOTOR::~STEPPER_MOTOR(){} //Destructor
-
+int STEPPER_MOTOR::Get_Steps_Done()
+{
+ return _Steps_Done;
+}
void STEPPER_MOTOR::Rotate_Steps(int Steps)
{
#define STIME 1000
@@ -17,7 +20,7 @@
Steps = Steps*50;
//int correctionfactor;
//int timeofturn=correctinfactor*speed;
-
+ _Steps_Done = 0;
int mystep=0;
//printf("START!!! step value is=%d\n\r",mystep);
for(int x =0 ; x <= Steps; x++)
@@ -54,6 +57,7 @@
this->pin4 = 1;
mystep=4;
wait_us(1000);
+ _Steps_Done = _Steps_Done+1;
/* printf("FOR LOOP! step value is=%d %d\n\r",mystep,x);
this->pin1 = 0;