Browse Source

Update autonomous car Module v1.1

master
Evangelos Oulis 5 years ago
parent
commit
97f109139a
  1. 4
      autonomousCar/driver.ino
  2. 4
      stepMotor/step_motor/step_motor.ino

4
autonomousCar/driver/driver.ino → autonomousCar/driver.ino

@ -210,10 +210,12 @@ void loop() {
// Prints the distance on the Serial Monitor // Prints the distance on the Serial Monitor
//Serial.print("Distance: "); //Serial.print("Distance: ");
//Serial.println(distance); Serial.println(distance);
forward();
if (distance < 9){ if (distance < 9){
motor_stop(); motor_stop();
turn(); turn();
delay(1500);
forward(); forward();
} }
delay(500); delay(500);

4
stepMotor/step_motor.ino → stepMotor/step_motor/step_motor.ino

@ -27,7 +27,7 @@ const float STEPS_PER_OUT_REV = STEPS_PER_REV * GEAR_RED;
// Number of Steps Required // Number of Steps Required
const int stepper_motor_speed = 700; const int stepper_motor_speed = 600;
int pos = 1; int pos = 1;
const int StepsRequired = STEPS_PER_OUT_REV / 4; const int StepsRequired = STEPS_PER_OUT_REV / 4;
// Create Instance of Stepper Class // Create Instance of Stepper Class
@ -36,7 +36,7 @@ const int StepsRequired = STEPS_PER_OUT_REV / 4;
// Connected to ULN2003 Motor Driver In1, In2, In3, In4 // Connected to ULN2003 Motor Driver In1, In2, In3, In4
// Pins entered in sequence 1-3-2-4 for proper step sequencing // Pins entered in sequence 1-3-2-4 for proper step sequencing
Stepper steppermotor(STEPS_PER_REV, 6, 10, 11, 13); Stepper steppermotor(STEPS_PER_REV, 6, 8, 12, 13);
void setup() void setup()
{ {
Loading…
Cancel
Save