diff options
| author | abel <71026016+ableTI@users.noreply.github.com> | 2024-04-17 16:31:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-17 16:31:36 +0200 |
| commit | 04daead3813f008e3657e092ffb86c9034e3cdbc (patch) | |
| tree | e9fc48a8eea312d88d9922d9535d6f6a217da61a | |
| parent | 4be541c763f9792a0217d481c37248f15bd8bcbb (diff) | |
| download | robotica-04daead3813f008e3657e092ffb86c9034e3cdbc.tar.gz robotica-04daead3813f008e3657e092ffb86c9034e3cdbc.zip | |
Add files via upload
| -rw-r--r-- | robotica_Robot.ino | 9 |
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); |
