prog.c:4:1: error: unknown type name 'byte'
byte ON; // 設定ON給腳位9使用
^
prog.c: In function 'setup':
prog.c:17:3: error: 'Serial' undeclared (first use in this function)
Serial.begin(9600);
^
prog.c:17:3: note: each undeclared identifier is reported only once for each function it appears in
prog.c:18:3: warning: implicit declaration of function 'pinMode' [-Wimplicit-function-declaration]
pinMode(a,OUTPUT);
^
prog.c:18:13: error: 'OUTPUT' undeclared (first use in this function)
pinMode(a,OUTPUT);
^
prog.c:21:13: error: 'INPUT' undeclared (first use in this function)
pinMode(f,INPUT);
^
prog.c:24:3: warning: implicit declaration of function 'digitalRead' [-Wimplicit-function-declaration]
ON = digitalRead(f);
^
prog.c:25:3: warning: implicit declaration of function 'digitalWrite' [-Wimplicit-function-declaration]
digitalWrite(a,LOW);
^
prog.c:25:18: error: 'LOW' undeclared (first use in this function)
digitalWrite(a,LOW);
^
prog.c: In function 'loop':
prog.c:36:5: warning: implicit declaration of function 'delayMicroseconds' [-Wimplicit-function-declaration]
delayMicroseconds(100);
^
prog.c:37:5: warning: implicit declaration of function 'soungLwall' [-Wimplicit-function-declaration]
soungLwall(sLwall);
^
prog.c:38:5: warning: implicit declaration of function 'soungL' [-Wimplicit-function-declaration]
soungL(sL);
^
prog.c:39:5: warning: implicit declaration of function 'soungM' [-Wimplicit-function-declaration]
soungM(sM);
^
prog.c:40:5: warning: implicit declaration of function 'soungR' [-Wimplicit-function-declaration]
soungR(sR);
^
prog.c:41:5: warning: implicit declaration of function 'soungRwall' [-Wimplicit-function-declaration]
soungRwall(sRwall);
^
prog.c:43:7: warning: implicit declaration of function 'Left' [-Wimplicit-function-declaration]
Left(2);
^
prog.c:44:7: warning: implicit declaration of function 'Run' [-Wimplicit-function-declaration]
Run(6);
^
prog.c:46:7: warning: implicit declaration of function 'delay' [-Wimplicit-function-declaration]
delay(300);
^
prog.c:47:7: warning: implicit declaration of function 'MinBack' [-Wimplicit-function-declaration]
MinBack(45);
^
prog.c:49:7: warning: implicit declaration of function 'Right' [-Wimplicit-function-declaration]
Right(22);
^
prog.c:51:7: warning: implicit declaration of function 'MidRight' [-Wimplicit-function-declaration]
MidRight(10);
^
prog.c:70:9: warning: implicit declaration of function 'MidLeft' [-Wimplicit-function-declaration]
MidLeft(4);
^
prog.c: At top level:
prog.c:193:15: error: conflicting types for 'soungLwall'
unsigned long soungLwall(int pin){
^
prog.c:37:5: note: previous implicit declaration of 'soungLwall' was here
soungLwall(sLwall);
^
prog.c: In function 'soungLwall':
prog.c:194:16: error: 'OUTPUT' undeclared (first use in this function)
pinMode(pin, OUTPUT); // Set pin to OUTPUT
^
prog.c:195:21: error: 'LOW' undeclared (first use in this function)
digitalWrite(pin, LOW); // Ensure pin is low
^
prog.c:197:21: error: 'HIGH' undeclared (first use in this function)
digitalWrite(pin, HIGH); // Start ranging
^
prog.c:200:16: error: 'INPUT' undeclared (first use in this function)
pinMode(pin, INPUT); // Set pin to INPUT
^
prog.c:201:3: warning: implicit declaration of function 'pulseIn' [-Wimplicit-function-declaration]
duration = pulseIn(pin, HIGH); // Read echo pulse
^
prog.c:203:3: error: 'Serial' undeclared (first use in this function)
Serial.print(cm0); // Display result
^
prog.c: At top level:
prog.c:208:15: error: conflicting types for 'soungL'
unsigned long soungL(int pin){
^
prog.c:38:5: note: previous implicit declaration of 'soungL' was here
soungL(sL);
^
prog.c: In function 'soungL':
prog.c:209:16: error: 'OUTPUT' undeclared (first use in this function)
pinMode(pin, OUTPUT); // Set pin to OUTPUT
^
prog.c:210:21: error: 'LOW' undeclared (first use in this function)
digitalWrite(pin, LOW); // Ensure pin is low
^
prog.c:212:21: error: 'HIGH' undeclared (first use in this function)
digitalWrite(pin, HIGH); // Start ranging
^
prog.c:215:16: error: 'INPUT' undeclared (first use in this function)
pinMode(pin, INPUT); // Set pin to INPUT
^
prog.c:218:3: error: 'Serial' undeclared (first use in this function)
Serial.print(cm1); // Display result
^
prog.c: At top level:
prog.c:223:15: error: conflicting types for 'soungM'
unsigned long soungM(int pin){
^
prog.c:39:5: note: previous implicit declaration of 'soungM' was here
soungM(sM);
^
prog.c: In function 'soungM':
prog.c:224:16: error: 'OUTPUT' undeclared (first use in this function)
pinMode(pin, OUTPUT); // Set pin to OUTPUT
^
prog.c:225:21: error: 'LOW' undeclared (first use in this function)
digitalWrite(pin, LOW); // Ensure pin is low
^
prog.c:227:21: error: 'HIGH' undeclared (first use in this function)
digitalWrite(pin, HIGH); // Start ranging
^
prog.c:230:16: error: 'INPUT' undeclared (first use in this function)
pinMode(pin, INPUT); // Set pin to INPUT
^
prog.c:233:3: error: 'Serial' undeclared (first use in this function)
Serial.print(cm2); // Display result
^
prog.c: At top level:
prog.c:238:15: error: conflicting types for 'soungR'
unsigned long soungR(int pin){
^
prog.c:40:5: note: previous implicit declaration of 'soungR' was here
soungR(sR);
^
prog.c: In function 'soungR':
prog.c:239:16: error: 'OUTPUT' undeclared (first use in this function)
pinMode(pin, OUTPUT); // Set pin to OUTPUT
^
prog.c:240:21: error: 'LOW' undeclared (first use in this function)
digitalWrite(pin, LOW); // Ensure pin is low
^
prog.c:242:21: error: 'HIGH' undeclared (first use in this function)
digitalWrite(pin, HIGH); // Start ranging
^
prog.c:245:16: error: 'INPUT' undeclared (first use in this function)
pinMode(pin, INPUT); // Set pin to INPUT
^
prog.c:248:3: error: 'Serial' undeclared (first use in this function)
Serial.print(cm3); // Display result
^
prog.c: At top level:
prog.c:253:15: error: conflicting types for 'soungRwall'
unsigned long soungRwall(int pin){
^
prog.c:41:5: note: previous implicit declaration of 'soungRwall' was here
soungRwall(sRwall);
^
prog.c: In function 'soungRwall':
prog.c:254:16: error: 'OUTPUT' undeclared (first use in this function)
pinMode(pin, OUTPUT); // Set pin to OUTPUT
^
prog.c:255:21: error: 'LOW' undeclared (first use in this function)
digitalWrite(pin, LOW); // Ensure pin is low
^
prog.c:257:21: error: 'HIGH' undeclared (first use in this function)
digitalWrite(pin, HIGH); // Start ranging
^
prog.c:260:16: error: 'INPUT' undeclared (first use in this function)
pinMode(pin, INPUT); // Set pin to INPUT
^
prog.c:263:3: error: 'Serial' undeclared (first use in this function)
Serial.print(cm4); // Display result
^
prog.c: In function 'MinLeft':
prog.c:270:20: error: 'HIGH' undeclared (first use in this function)
digitalWrite(a,HIGH);
^
prog.c:271:20: error: 'LOW' undeclared (first use in this function)
digitalWrite(b,LOW);
^
prog.c: In function 'Left':
prog.c:287:20: error: 'HIGH' undeclared (first use in this function)
digitalWrite(a,HIGH);
^
prog.c:293:25: error: 'LOW' undeclared (first use in this function)
digitalWrite(servoR,LOW);
^
prog.c: In function 'MidLeft':
prog.c:304:20: error: 'HIGH' undeclared (first use in this function)
digitalWrite(a,HIGH);
^
prog.c:306:20: error: 'LOW' undeclared (first use in this function)
digitalWrite(c,LOW);
^
prog.c: In function 'Run':
prog.c:321:20: error: 'HIGH' undeclared (first use in this function)
digitalWrite(a,HIGH);
^
prog.c:322:20: error: 'LOW' undeclared (first use in this function)
digitalWrite(b,LOW);
^
prog.c: In function 'MidRight':
prog.c:338:20: error: 'LOW' undeclared (first use in this function)
digitalWrite(a,LOW);
^
prog.c:340:20: error: 'HIGH' undeclared (first use in this function)
digitalWrite(c,HIGH);
^
prog.c: In function 'Right':
prog.c:355:20: error: 'LOW' undeclared (first use in this function)
digitalWrite(a,LOW);
^
prog.c:359:25: error: 'HIGH' undeclared (first use in this function)
digitalWrite(servoR,HIGH);
^
prog.c: In function 'MinRight':
prog.c:372:20: error: 'LOW' undeclared (first use in this function)
digitalWrite(a,LOW);
^
prog.c:373:20: error: 'HIGH' undeclared (first use in this function)
digitalWrite(b,HIGH);
^
prog.c: In function 'MinBack':
prog.c:390:20: error: 'LOW' undeclared (first use in this function)
digitalWrite(a,LOW);
^
prog.c:391:20: error: 'HIGH' undeclared (first use in this function)
digitalWrite(b,HIGH);
^
prog.c: In function 'MinLeft':
prog.c:283:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prog.c: In function 'Left':
prog.c:300:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prog.c: In function 'MidLeft':
prog.c:317:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prog.c: In function 'Run':
prog.c:334:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prog.c: In function 'MidRight':
prog.c:351:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prog.c: In function 'Right':
prog.c:368:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prog.c: In function 'MinRight':
prog.c:386:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prog.c: In function 'MinBack':
prog.c:403:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^