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.ccSteve Robillard– Steve Robillard2014年10月05日 22:08:02 +00:00Commented Oct 5, 2014 at 22:08
1 Answer 1
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).