The idea
I wanted Arduino users to be able to write simple keyboard automation scripts without manually converting every command into Keyboard library calls.
How it works
The library accepts a multiline raw string, separates it into individual lines, identifies each command, parses its argument, and executes the corresponding Arduino function.
DStoArduino(R"DS(
DELAY 1000
GUI r
STRING notepad
ENTER
STRING Hello World
)DS");
Interpreter pipeline
- Receive the raw string.
- Read one line at a time.
- Separate command from argument.
- Validate the command.
- Execute the Arduino equivalent.
Challenges
Important design problems include limited Arduino memory, keyboard layouts, line-length limits, error reporting, modifier combinations, and safely stopping a running script.
What I learned
This project introduced me to interpreters, parsing, string processing, USB HID behavior, library design, and the differences between desktop C++ and microcontroller programming.