hi JimboZA;
It's expert, because you had to code into it how to "solve" the problem, based on your expert opinion.
i am preparing my coding now onward. i just ordered a robot chassis on ebay and i am waiting till it arrive ;). here is a piece of my code below.
//If object detected < 5 cm, check for new course
if (distance < 5){
digitalWrite(redLed, HIGH);
digitalWrite(greenLed, LOW);
tone(speaker, 1000); //Speaker on
//First Stop the robot:
digitalWrite(motorPin1, LOW);digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);digitalWrite(motorPin4, LOW);
//Now, check space for obstacles:
for(pos = 10; pos < 170; pos += 1){ // goes from 10 degrees to 170 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(10); // waits 10ms for the servo to reach the position
}
checkLeft = sensor.Ranging(CM);
for(pos = 170; pos>=11; pos-=1){ // goes from 170 degrees to 10 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(10); // waits 10ms for the servo to reach the position
}
checkRight= sensor.Ranging(CM);
myservo.write(90); // Sensor "look" forward
//Finally, take the right decision, turn left or right?
if (checkLeft < checkRight){
digitalWrite(motorPin1, LOW) ;digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, HIGH);digitalWrite(motorPin4, LOW);
delay(1200); // delay, change value if necessary to make robot turn.
}
else if (checkLeft > checkRight){
digitalWrite(motorPin1, HIGH);digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW) ;digitalWrite(motorPin4, HIGH);
delay(1200); // delay, change value if necessary to make robot turn.
}
}
//No object detected? Ok... all crear to move forward!
else {
digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, LOW);
digitalWrite(redLed, LOW);
digitalWrite(greenLed, HIGH);
noTone(speaker); //Speaker off
}
delay(50); //small delay to read a new distance value from sensor
}
dear steinie44;
Are we talking 'artificial intelligence' or 'intelligence'?
There is a big difference.
i am sorry, i am talking about artificial intelligence