I realize this might not be a typical RPi question.

However, I have a RPi with a Gertduino plugged into the GPIO headers.

I can use the wrapper program_328 for avrdude to upload a precompiled blink.hex file. OR use the arduino program (with X11 forwarded to my local machine) and upload the sketch with the "Upload sketch with programmer"

However, how can I write raw "sketch"/C code, and then compile it to the proper hex file and use the wrapper program_328 to upload the hex code to the Gertduino without using the arduino program?

  • you can probably use avr dude (which is what the arduino program does in the background) to upload a compiled file. As for compiling you can use avr studio and may even be able to use the cloud ide codebender.cc Oct 5 '14 at 22:08

I am not totally familiar with the Gertduino, but use a Gertboard. Both are programmed using the ICSP interface. program_328 is a script used to upload to this, Avrdude for Gertboard uploads using avrdude with appropriate configuration files provided by Gordon Henderson, as described on his site. You should be able to use either program_328 or avrdude to upload HEX files.

If your question is how to compile c code to hex then you would use the avr compiler avr-gcc (located in /usr/bin).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.