ESE519 Lab6 Part3
Dependencies: MPU6050_Lab6_Part3 mbed
Fork of BroBot_v2 by
Diff: stepper_motors.h
- Revision:
- 6:ae3e6aefe908
- Parent:
- 4:2512939c10f0
diff -r ebc985efc892 -r ae3e6aefe908 stepper_motors.h --- a/stepper_motors.h Tue Oct 18 20:46:01 2016 +0000 +++ b/stepper_motors.h Thu Nov 10 19:20:55 2016 +0000 @@ -1,5 +1,9 @@ +//stepper_motors.h +//Author: Carter Sharer +//Date: 10/10/2016 + //STEPPER MOTORS -#define ZERO_SPEED 65535 +#define ZERO_SPEED 10000000 //65535 #define MAX_ACCEL 7 #define ENABLE 0 #define DISABLE 1 @@ -32,7 +36,7 @@ wait_us(1); step_M1 = 0; - //Update Postion + //Update Motor Postion if(dir_M1) pos_M1++; else @@ -46,14 +50,14 @@ wait_us(1); step_M2 = 0; - //Update Position + //Update Motor Position if(dir_M2) pos_M2++; else pos_M2--; } -//Set motor 1 speed. Speed [-100, +100] +//Set motor 1 speed. Speed [-100, 0, +100] = [Max Reverse, Stop, Max Forward] void setMotor1Speed(int16_t speed) { long timer_period; @@ -83,7 +87,7 @@ timer_M1.attach_us(&ISR1, timer_period); //This is what sets motor speed } -//Set motor 2 speed. Speed [-100, +100] +//Set motor 2 speed. Speed [-100, 0, +100] = [Max Reverse, Stop, Max Forward] void setMotor2Speed(int16_t speed) { long timer_period;