To call this a compiler is an stretch of the imagination, but basically what this code does is using LLMs to transform human language into Arduino .ino files.
Right now only OpenAI API is supported.
You must create a token.json
file on the same folder as generator.py
. Said file must contain your API key and your organization key, in this way:
{
"key": "API_KEY",
"org": "ORG_KEY"
}
with API_KEY
and ORG_KEY
being your actual keys.
Navigate to the same folder where requirements.txt
is and type:
pip install -r requirements.txt
write your prompt in a file with .human
extension, and call the arduinoLLM.py file like such:
python arduinoLLM.py <INPUT_FILE>
with <INPUT_FILE>
being the name of your file.
The output file should appear in a main/main.ino
file in the same directory as INPUT_FILE
.
The latest version of the Arduino IDE supports external writes to an opened file, which means that if you open the
main/main.ino
file on the IDE you will be able to see, edit, and upload it right away after it is generated by the AI.
This is as untested as it can get. No clean output is ensured by the AI, and in no way there is any guarantee that the output code will do what it is expected from it. The authors of this repo, as well as the providers of the LLMs bear no responsibility of any damage or undesired effect this software might cause.
DO NOT COMMIT YOUR API KEYS