Thanks in advance, i have the following code, it returns an infinite statement and i know why cause of the while loop, but my problem is that it returns 1 instead of "OFF". I can make this work with an if else loop but i want to get comfortable using ternaries.