This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

for loop not executing

Good Day, i am writing a code for a density based traffic light project using for loops for the density part of the system, but my for loops wont execute. the code is attached below.

Parents
  • Let me explain the idea of the code:
    i am emulating a density based traffic system for a 4 way traffic junction. the code for the normal operation of a traffic junction works fine.

    where i am having difficulty is the part where i take inputs from one or 2 of the sensor ports and make them 'on' using a for loop for when this condition is meet signifying the lane where those sensor are has a higher density and should be given priority.

    so am i approaching it wrong, or is there a problem with a part of the code. as this is the only problematic part of the code.

Reply
  • Let me explain the idea of the code:
    i am emulating a density based traffic system for a 4 way traffic junction. the code for the normal operation of a traffic junction works fine.

    where i am having difficulty is the part where i take inputs from one or 2 of the sensor ports and make them 'on' using a for loop for when this condition is meet signifying the lane where those sensor are has a higher density and should be given priority.

    so am i approaching it wrong, or is there a problem with a part of the code. as this is the only problematic part of the code.

Children