Skip to content

Commit

Permalink
Revert "Fix detection of crossings using Makeblock RGB Line-Follower …
Browse files Browse the repository at this point in the history
…Sensor"

This reverts commit 53583e8.
  • Loading branch information
lmoellendorf committed Mar 14, 2024
1 parent 53583e8 commit 366e137
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
* Each time the result of the bitwise AND operation is greater 0 the Bit is
* counted. In the above example the counted number is 3.
*
* A crossing may be detected if the number Bits is significantly lesser than
* A crossing may be detected if the number Bits is significantly greater than
* the number of sensors covered by the line. Note, that the number of sensors
* covered by the line is also lesser if the Line Leader is at an angle to the
* covered by the line is also greater if the Line Leader is at an angle to the
* line.
*/
#include <MeAuriga.h>
Expand All @@ -79,7 +79,6 @@ void loop() {

linefollower.loop();

/* 4bit value, each set bit denotes sensor faces background */
position = linefollower.getPositionState();

/* line follower hase 4 sensors to check */
Expand All @@ -97,14 +96,13 @@ void loop() {
Serial.print("Position state: ");
Serial.println(position, BIN);
Serial.print("Line width: ");
Serial.println(4 - counter);
Serial.println(counter);

/**
* if the line normally covers 1 sensor, a counter of 1 or less is most
* if the line normally covers 1 sensor, a counter of 3 or greater is most
* likely indicating a crossing
*/
if (counter < 2) {
if (counter > 2) {
Serial.println("Looks like a crossing!");
}
delay(200);
}

0 comments on commit 366e137

Please sign in to comment.