Browse Source

Update v1.3

master
Evangelos Oulis 5 years ago
parent
commit
a61278edfb
  1. 13
      autonomousCar/autonomousCar.ino

13
autonomousCar/autonomousCar.ino

@ -53,6 +53,7 @@
/*Definition for turn time*/
#define TURN_TIME 800
#define FORWARD_STEP 200
/*
* -------------------------------------------------------
@ -257,9 +258,9 @@ void moveCar(){
void park(int parkingNo) {
int row = (parkingNo / 2) + 1;
int side = (parking % 2) //If side is 1 then the parking is to right
int side = (parkingNo % 2); //If side is 1 then the parking is to right
// else if is 0 the parking is to left.
distance= getDistance(); //take the distance from ultrasonic sensor
distance = getDistance(); //take the distance from ultrasonic sensor
while (row > 1) {
absolute(255);
@ -273,6 +274,7 @@ void park(int parkingNo) {
//Check the side value to turn.
if (side == 1) {
turnRight(255);
}
else {
turnLeft(255);
}
@ -291,7 +293,13 @@ void park(int parkingNo) {
int Serial_Input()
{
int number;
<<<<<<< HEAD
while (!Serial.available()) ;
=======
Serial.flush();
while(!Serial.available()) ;
>>>>>>> dce72c29be70c5124af0193dc8a435a5deb10bfb
if (Serial.available() > 0) {
number = Serial.parseInt();
while (number <= 0) {
@ -317,7 +325,6 @@ void loop() {
//Serial.print("Distance: ");
//Serial.println(distance);
// Read serial input:
park(Serial_Input());
//delay(1000);
// if (distance <15) {

Loading…
Cancel
Save