Justchillbruh122
Forum Guru
.
if (cardMatch) statement is not closed with a curly brace. If this is not the last line of code in a larger function, this could result in syntax errors.while (true) loop is an infinite loop, which can cause the program to become unresponsive if there is no way to break out of it. In this case, the loop appears to be waiting for an IR sensor to detect an obstacle, but it is not clear how the program should exit the loop once that happens.delay(200) inside the while loop could be causing the program to be unresponsive to other input during this time.myservo is not properly initialized before this code runs, the myservo.write() calls could cause errors.cardMatch variable is or how it is defined. It is possible that the problem lies in a different part of the code that sets or checks this variable.