Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #203146
| From | Linux-Fan <Ma_Sys.ma@web.de> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: Non-GUI Arduino IDE ? |
| Date | 2018-12-08 01:10 +0100 |
| Message-ID | <x2ylX-1W6-1@gated-at.bofh.it> (permalink) |
| References | <x2rkt-5Q9-1@gated-at.bofh.it> <x2rXb-6i4-1@gated-at.bofh.it> <x2xgd-Wt-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
Jason writes:
> On Fri, Dec 07, 2018 at 05:05:30PM -0000, Dan Purgert wrote:
> > Jason wrote:
> > > Does anyone know if there is a console based Arduino IDE available for
> > > Debian? I am interested in making a portable programmer that could be
> > > taken out on a job to edit and upload Arduino programs on site, without
> > > messing with a mouse.
> >
> > Don't know of any IDEs for the commandline, but you can always use
> > avrdude straight from the commandline to handle writing the compiled hex
> > to the thing.
>
> And what could I use to create the compiled hex?
Hello,
I was able to get to run a blinking program on an Arduino Nano v3 with the
following codes (two files, .hex and .o file are generated as part of the
process):
-- BEGIN Makefile --
# depends: avr-libc, avrdude, gcc-avr
build:
avr-gcc -Os -DF_CPU=16000000UL -mmcu=atmega328p -c -o led.o led.c
avr-gcc -mmcu=atmega328p led.o -o led
avr-objcopy -O ihex -R .eeprom led led.hex
upload:
avrdude -F -V -c arduino -p ATMEGA328P -P /dev/ttyUSB0 \
-b 57600 -U flash:w:led.hex
-- END Makefile --
-- BEGIN led.c --
#include <avr/io.h>
#include <util/delay.h>
#define BLINK_DELAY_MS 2000
void main()
{
/* PB5(SCK) = 17 = D13 = LED3 */
/* set pin 5 of PORTB for output*/
DDRB |= _BV(DDB5);
while(1) {
/*
* _BV: Bit mask for port: /usr/lib/avr/include/avr/iom328p.h
* /usr/lib/avr/include/avr/sfr_defs.h
*/
/* set pin 5 high to turn led on */
PORTB |= _BV(PORTB5);
_delay_ms(BLINK_DELAY_MS);
/* set pin 5 low to turn led off */
PORTB &= ~_BV(PORTB5);
_delay_ms(BLINK_DELAY_MS);
}
}
-- END led.c --
It is invoked as follows
$ make build
$ make upload
and assumes that the Arduino is recognized under /dev/ttyUSB0.
HTH
Linux-Fan
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Non-GUI Arduino IDE ? Jason <electron@emypeople.net> - 2018-12-07 17:40 +0100
Re: Non-GUI Arduino IDE ? Joe <joe@jretrading.com> - 2018-12-07 17:50 +0100
Re: Non-GUI Arduino IDE ? Joe <joe@jretrading.com> - 2018-12-07 17:50 +0100
Re: Non-GUI Arduino IDE ? Dan Purgert <dan@djph.net> - 2018-12-07 18:20 +0100
Re: Non-GUI Arduino IDE ? deloptes <deloptes@gmail.com> - 2018-12-07 19:20 +0100
Re: Non-GUI Arduino IDE ? Jason <electron@emypeople.net> - 2018-12-08 00:00 +0100
Re: Non-GUI Arduino IDE ? Linux-Fan <Ma_Sys.ma@web.de> - 2018-12-08 01:10 +0100
Re: Non-GUI Arduino IDE ? Erik Christiansen <dvalin@internode.on.net> - 2018-12-08 03:40 +0100
Re: Non-GUI Arduino IDE ? Jason <electron@emypeople.net> - 2018-12-08 18:00 +0100
Re: Non-GUI Arduino IDE ? Dan Purgert <dan@djph.net> - 2018-12-08 13:20 +0100
Re: Non-GUI Arduino IDE ? conover@rahul.net (John Conover) - 2018-12-07 18:20 +0100
Re: Non-GUI Arduino IDE ? Cindy-Sue Causey <butterflybytes@gmail.com> - 2018-12-07 18:20 +0100
Re: Non-GUI Arduino IDE ? Jason <electron@emypeople.net> - 2018-12-08 00:00 +0100
Re: Non-GUI Arduino IDE ? Ryan Nowakowski <tubaman@fattuba.com> - 2018-12-09 02:30 +0100
csiph-web