Help learning how to create a Makefile

Hello all I am new to Arduino and C++. I have used Arduino to make a USB device that run on Windows 10. I now would like this Arduino code to use system variables to help decide what commands it runs. I have read that Arduino can not do this. The suggestion is to add your Arduino code to a Makefile. I am up for this. However, I cannot find any good tutorials on the web on how to do this. To be clear not how to use system variables in your sketch logic, but how to include your current sketch in a Makefile. Could someone point me to some instructions on how this is done using a Windows Computer? Thanks

Maybe first of all, start by describing, in a little more detail, the Arduino USB device running on Windows 10, which you have developed.

It would not be impossible for an Arduino to interrogate system variables on a PC, but you would need to run a script on the PC (say in Powershell) which the Arduino could talk to over a serial link.

Hi thanks for the reply. I have made a rotary encoder project. I am new to Arduino and this forum. Does including the sketch and a schematic do enough to explain my project. I will include them in the Attachments. I would like to know how to include them in a script that can access system information like environment variable. Thanks for any help J—

rotaryProj1.jpg

sketch_may06a.ino (4.84 KB)

I also like the suggestion to communicate over a serial link. I had though of this myself because I was thinking of a time when we use to use that window on PC that would setup a modem and choose the COM and select a baud rate (those were the days). Yes I am interested in anyway or suggestion I could looking to getting this accomplished. Preferably the recommended best practice way. I think this will be something I need to learn about as my Arduino project improve and get more complex.

I wrote a client server application once where the server part was an Arduino, and one client part was a Windows PC powershell application. Powershell is available as standard on PCs and can be used to fetch system information.

The project , including source code and documentation is all here. It is a telephone caller ID system supporting several client types.
https://forum.arduino.cc/index.php?topic=642458.0