Benutzer-Werkzeuge

Webseiten-Werkzeuge


arduino

Dies ist eine alte Version des Dokuments!


Arduino

10.12.2014

Sublime IDE

https://sublime.wbond.net/packages/Arduino-like%20IDE

This should be great, since it has the sublime autocompletion, which is really missing in the original Arduiono IDE.

ino - The Command Line Interface

10.12.2014

I just found this project on github:
https://github.com/amperka/ino

for installation on Kubuntu 14.04 we need:

cd ~/programms
git clone git://github.com/amperka/ino.git
cd ino
sudo apt-get install python-pip python-jinja2
sudo pip install glob2 jinja2 pyserial configobj ordereddict argparse
sudo apt-get install python-serial

Here is the documentation for it:
http://inotool.org/quickstart

~/.inorc

in this config file, which is not installed by default, we can set default settings. For me the most important one is the path to the arduino distribtion.

.inorc
[build]
board-model = nano328
arduino-dist = /home/karl/Programme/arduino-1.0.6/
 
[upload]
board-model = nano328
arduino-dist = /home/karl/Programme/arduino-1.0.6/
serial-port = /dev/ttyUSB0
 
[serial]
serial-port = /dev/ttyUSB0

Important: Don't forget to define the arduino-dist for both, the build and the upload command. Otherwise the upload command doesn't find the correct build-path, which as a suffix which is generated from the arduino-dist-dir.

Compile existing project

If we have an existing folder, with it's source files, we have to do a little adoption, so we can compile it with ino:
We need a defined folder structure:

projectpath/
  ./lib/
  ./src/
    ./sketch.ino

So the starting point of the project must be in sketch.ino.
Then we can run this:

:~/projectpath$ ino build

For uploading to the board we use

ino upload

Example

Her is an example file structure after building the project

.
└── simple-control
    ├── .build
    │   ├── environment.pickle
    │   ├── nano328-a89b84a3
    │   │   ├── arduino
    │   │   │   ├── avr-libc
    │   │   │   │   ├── malloc.d
    │   │   │   │   ├── malloc.o
    │   │   │   │   ├── realloc.d
    │   │   │   │   └── realloc.o
    │   │   │   ├── CDC.d
    │   │   │   ├── CDC.o
    │   │   │   ├── dependencies.d
    │   │   │   ├── HardwareSerial.d
    │   │   │   ├── HardwareSerial.o
    │   │   │   ├── HID.d
    │   │   │   ├── HID.o
    │   │   │   ├── IPAddress.d
    │   │   │   ├── IPAddress.o
    │   │   │   ├── libarduino.a
    │   │   │   ├── main.d
    │   │   │   ├── main.o
    │   │   │   ├── new.d
    │   │   │   ├── new.o
    │   │   │   ├── Print.d
    │   │   │   ├── Print.o
    │   │   │   ├── Stream.d
    │   │   │   ├── Stream.o
    │   │   │   ├── Tone.d
    │   │   │   ├── Tone.o
    │   │   │   ├── USBCore.d
    │   │   │   ├── USBCore.o
    │   │   │   ├── WInterrupts.d
    │   │   │   ├── WInterrupts.o
    │   │   │   ├── wiring_analog.d
    │   │   │   ├── wiring_analog.o
    │   │   │   ├── wiring.d
    │   │   │   ├── wiring_digital.d
    │   │   │   ├── wiring_digital.o
    │   │   │   ├── wiring.o
    │   │   │   ├── wiring_pulse.d
    │   │   │   ├── wiring_pulse.o
    │   │   │   ├── wiring_shift.d
    │   │   │   ├── wiring_shift.o
    │   │   │   ├── WMath.d
    │   │   │   ├── WMath.o
    │   │   │   ├── WString.d
    │   │   │   └── WString.o
    │   │   ├── firmware.elf
    │   │   ├── firmware.hex
    │   │   ├── Makefile
    │   │   ├── Makefile.deps
    │   │   ├── Makefile.sketch
    │   │   └── src
    │   │       ├── dependencies.d
    │   │       ├── message-interpreter.cpp
    │   │       ├── message-interpreter.d
    │   │       ├── message-interpreter.o
    │   │       ├── sketch.cpp
    │   │       ├── sketch.d
    │   │       └── sketch.o
    │   └── uno-a89b84a3
    ├── lib
    └── src
        ├── message-interpreter.h
        ├── message-interpreter.ino
        ├── simple-control.h
        └── sketch.ino

avrdude and AVR ISP mkII with USB on Linux

unlike as decribed here, which is a bit more complicated http://stackoverflow.com/a/5414566 we just add the permissions for the USB device similar to that of an Android decivce in Debug-Mode:

create a file /etc/udev/rules.d/51-avrisp.rules with

sudo kate /etc/udev/rules.d/51-avrisp.rules

enter this content:

# AVR ISP mkII (like an Android Device in Debug-Mode):
SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", MODE="0666", GROUP="dialout"

save an close this file.

restart udev:

sudo service udev restart

unplug the programmer and plug it in again. now avrdude can be used without sodo!

an example call to avrdude could then be:

avrdude -U flash:w:firmware.hex -p m328p -c avrispmkII -P usb

Fuse Bit Calculator

avrdude

Example Invocations

arduino.1426946613.txt.gz · Zuletzt geändert: 2015/03/21 15:03 von karl