summaryrefslogtreecommitdiff
path: root/robotica_Robot.ino
diff options
context:
space:
mode:
authorabel <71026016+ableTI@users.noreply.github.com>2024-04-17 16:31:36 +0200
committerGitHub <noreply@github.com>2024-04-17 16:31:36 +0200
commit04daead3813f008e3657e092ffb86c9034e3cdbc (patch)
treee9fc48a8eea312d88d9922d9535d6f6a217da61a /robotica_Robot.ino
parent4be541c763f9792a0217d481c37248f15bd8bcbb (diff)
downloadrobotica-04daead3813f008e3657e092ffb86c9034e3cdbc.tar.gz
robotica-04daead3813f008e3657e092ffb86c9034e3cdbc.zip
Add files via upload
Diffstat (limited to 'robotica_Robot.ino')
-rw-r--r--robotica_Robot.ino9
1 files changed, 5 insertions, 4 deletions
diff --git a/robotica_Robot.ino b/robotica_Robot.ino
index 769ecc6..359d161 100644
--- a/robotica_Robot.ino
+++ b/robotica_Robot.ino
@@ -228,7 +228,6 @@ void findball(int irs1, int irs2, int irs3, int irs4, int irs5, int irs6, int sp
//60deg
Amove(-spedo);
Cmove(spedo);
- }
}else if (irs3 == 0){
//120deg
Amove(-spedo);
@@ -247,8 +246,9 @@ void findball(int irs1, int irs2, int irs3, int irs4, int irs5, int irs6, int sp
Bmove(-spedo);
Amove(spedo);
}
- else(){
- forward(speed);
+ else{
+ //turn to search ball
+ turn(spedo);
}
}
@@ -316,7 +316,7 @@ void setup() {
void loop() {
- delay(1);
+ delay(100);
Wire.begin();
Serial.println("\nPCAScanner ready!");
//port expander
@@ -422,6 +422,7 @@ void loop() {
stil need to check what color it uses
**/
+ findball(ir1, ir2, ir3, ir4, ir5, ir6, sp);