Inspired from that reddit post.
I wrote a morse translator first that'd just translate English letters to morse code. Then I wrote a function to display the morse code. For all this I reffered the morse wiki.
For the led on and off code, I reffered this reddit post.
- Run the following commands in terminal or add
ec_sys.write_support=1to your kernel parameters.
sudo modprobe -r ec_sys
sudo modprobe ec_sys write_support=1
- Clone this repository and run the python file as root.
sudo python3 thinkled_morsecode/morsecode.py
I want to make this code work with all the leds on the laptop, which can be accessed through sys/class/leds. That will also allow this code to work with other laptops.