I can’t find the error in using if

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project :wink: See About the Installation & Troubleshooting category.

Please post complete code; I seem to be missing setup() and possibly other things.