Serial available function

That program does not wait for analogue input; it waits for serial input.

In the sketch, you do not have to set the serial port. The terminal program (e.g. Serial Monitor) that you use needs to be configured for the correct COM port and baudrate. In case you're not using Serial Monitor, you will also have to configure other parameters like format (8N1).

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

Please use code tags when posting code. Please edit your post, select all code and click the </> button; next save your post.