Browse Source

Update V1.3

master
cs131110 4 years ago
parent
commit
9e7a60f4fc
  1. 11
      autonomousCar/autonomousCar.ino
  2. 2
      serverNode/serv.py

11
autonomousCar/autonomousCar.ino

@ -124,8 +124,6 @@ void setup() {
void serialFlush(){ void serialFlush(){
while(Serial.available() > 0) { while(Serial.available() > 0) {
char t = Serial.read(); char t = Serial.read();
if(t == '\0')
break;
} }
} }
@ -286,9 +284,8 @@ void park(int parkingNo) {
absolute(255); absolute(255);
while(getDistance()>10){ while(getDistance()>10){
absolute(255);
forward(); forward();
delay(300); delay(100);
} }
motor_stop(); motor_stop();
} }
@ -319,13 +316,13 @@ int Serial_Input()
void loop() { void loop() {
// Calculating the distance // Calculating the distance
//distance= getDistance(); distance= getDistance();
// 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);
// Read serial input: // Read serial input:
park(Serial_Input()); park(Serial_Input());
//delay(800); //delay(800);
// if (distance <15) { // if (distance <15) {
// // Change direction to motors // // Change direction to motors

2
serverNode/serv.py

@ -88,7 +88,7 @@ class Parking(Resource):
parks = None parks = None
try: try:
parks = getParkings() parks = getParkings()
except mysql.connector.errors.DatabaseError as e: except (mysql.connector.errors.DatabaseError, mysql.connector.errors.InterfaceError) as e:
mydb.reconnect(attempts=1, delay=0) mydb.reconnect(attempts=1, delay=0)
return parks, 200 return parks, 200

Loading…
Cancel
Save