Is there a function which returns the connected computer's OS?

Hello,

I'm using a Leonardo (atmega32u4) and I want it to behave differently depending on which operating system it's connected to via USB.

It'll just simplify my code a bit if a function is out there which returns the operating system. If not I think I'll just have to code an operating system selector in or something.

Thank you

I'm using a Leonardo (atmega32u4) and I want it to behave differently depending on which operating system it's connected to via USB.

There must be some application on the other end of the serial port. That application should be responsible for telling you which OS it is running on.

Not really what you're looking for but you could get information on which OS the sketch was compiled on by parsing the FILE macro. However, that doesn't tell you anything about the OS running on any computer the device is connected to later.