For Linux at least, there is the LED subsystem that does what you want. From kernel documentation:
In its simplest form, the LED class just allows control of LEDs from
userspace. LEDs appear in /sys/class/leds/. The maximum brightness of the
LED is defined in max_brightness file. The brightness file will set the brightness
of the LED (taking a value 0-max_brightness). Most LEDs don't have hardware
brightness support so will just be turned on for non-zero brightness settings.
The class also introduces the optional concept of an LED trigger. A trigger
is a kernel based source of led events. Triggers can either be simple or
complex. A simple trigger isn't configurable and is designed to slot into
existing subsystems with minimal additional code. Examples are the disk-activity,
nand-disk and sharpsl-charge triggers. With led triggers disabled, the code
There is a way to do this without LEDs, by modulating activity on the CPU and turning a computer, even one without a wireless NIC, into a transmitter using a certain frequency. From the abstract of a research paper titled GSMem: Data Exfiltration from Air-Gapped Computers over GSM Frequencies:
Air-gapped networks are isolated, separated both logically and physically from public networks. Although the feasibility of invading such systems has been demonstrated in recent years, exfiltration of data from air-gapped networks is still a challenging task. In this paper we present GSMem, a malware that can exfiltrate data through an air-gap over cellular frequencies. Rogue software on an infected target computer modulates and transmits electromagnetic signals at cellular frequencies by invoking specific memory-related instructions and utilizing the multichannel memory architecture to amplify the transmission
It is also possible to do by utilizing general-purpose USB devices, such as flash drives. From a similar research paper titled USBee: Air-Gap Covert-Channel via Electromagnetic Emission from USB:
In this paper we present USBee, a software that can utilize an unmodified USB device connected to a computer as a RF transmitter. We demonstrate how a software can intentionally generate controlled electromagnetic emissions from the data bus of a USB connector. We also show that the emitted RF signals can be controlled and modulated with arbitrary binary data.
Similar techniques can be found by searching for research involving covert data exfiltration on air-gapped computers, particularly when involving electromagnetic emissions.