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.
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.
We've got past your initial problem. Now it's time for you to put your thinking cap on and consider the most suitable sequence to achieve your final result.