Skip to content

Missing a white line detection case #2

Description

@poupryc

Four cases must be managed by this function (which should perhaps be renamed).

  • no white line is detected
  • the right sensor detects a white line
  • the left sensor detects a white line
  • both sensors detects a white line

the last case seems to be forgotten

PS: maybe add an enum to make the return values clearer

int ligneBlanche()
{
// si le capteur de ligne blanche avant gauche ou droit est activé
if (analogRead(TCRT_G) <= SEUIL_GAUCHE) {
return AV_GAUCHE;
} else if (analogRead(TCRT_D) <= SEUIL_DROIT) {
return AV_DROIT;
} else {
return 0;
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions