![]() ![]() Pedes() or pedes2() depending on which button is pressed. Thanks! // If at any point in time during this code, a button is pushed, I want to run a function called I have posted my original code below that I want to run constantly until a button will be pressed. Then depending on which button was pressed, I want to run a function called pedes() or pedes2().įeel free to ask if you need any clarifications. I also need to get which button was pressed if that possible. I have tried it with while loops and if conditions but it just won't work because then it would read the button input at a specific point in time when I want it to read the readings constantly throughout the program and break the loop if the condition is ever untrue (while and do-while loops only check the condition at the end of the loop when I want it to check the condition throughout the loop). I want to listen for button readings (pedestrian buttons to turn pedestrian lights green) continuously throughout the program and want to run a different function that will handle pedestrian lights if the buttons are ever pressed during the program. I am trying to create a working physical simulation of a traffic light intersection. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |