Menu

Tree [2aa7f1] default tip /
 History

Read Only access


File Date Author Commit
 doc 2022-09-13 John Donoghue John Donoghue [5fa306] update to v0.10.0 for release
 inst 2022-09-13 John Donoghue John Donoghue [5fa306] update to v0.10.0 for release
 test 2019-06-09 John Donoghue John Donoghue [6d984c] Update functions and docs to use device instead...
 .hgignore 2022-01-18 John Donoghue John Donoghue [55d610] maint: add ihgignore
 .hgtags 2022-09-13 John Donoghue John Donoghue [dd75a3] Added tag release-0.10.0 for changeset 5fa3064d...
 COPYING 2018-08-16 John Donoghue John Donoghue [5ccc45] * COPYING: update for GNU GPL v3 license
 DESCRIPTION 2022-09-13 John Donoghue John Donoghue [5fa306] update to v0.10.0 for release
 INDEX 2022-04-28 John Donoghue John Donoghue [5c19d3] add lps22hb sensor
 Makefile 2022-07-18 John Donoghue John Donoghue [d51186] * Makefile: include package css in source-forge...
 NEWS 2022-09-13 John Donoghue John Donoghue [5fa306] update to v0.10.0 for release
 README.md 2023-06-29 John Donoghue John Donoghue [2aa7f1] Add note to readme to repo move
 octave-arduino.metainfo.xml 2018-11-20 John Donoghue John Donoghue [d1171d] * octave-arduino.metainfo.xml: added metainfo file

Read Me

Octave Arduino Toolkit

NOTE The arduino toolkit development has moved to https://github.com/gnu-octave/octave-arduino/


Introduction

This is a basic implementation of the Matlab toolkit extension.

It attempts to provide the same function calls as the Matlab toolkit, as well as additional functionality, HOWEVER,
it is not binary compatible with matlab. (ie: you must program the arduino with the GNU octave code to commuicate with the
octave arduino toolkit).

Requirements

The arduino toolkit requires the Arduino IDE for programming the arduino board,
and the instrument-control toolkit to communicate to
the board.

Installing

To install, run the octave package manager:

  1. To install from source forge:

    pkg install -forge arduino

  2. To install from a local tarball.

    pkg install arduino-XXXXXXX.tar.gz

    Where XXXXXXX is the version of the the downloaded tarball.

Usage:

  1. Load the arduino package.

    pkg load arduino

  2. If the arduino board is not programmed, program it with the arduino
    communication software.

    arduinosetup

    Additional libraries can be programmed with it. Use the listArduinoLibraries to
    retrieve a list of known libraries.

  3. Open a connection to the arduino

    a = arduino ()

    NOTE: the board MUST be programmed before the ardino function call will be abele to open the board connection.

  4. Use the arduino function calls to control arduino hardware.
    See the function list and examples directories.

Expanding the known board types

Currently the toolkit recognizes these boards:

  • due

  • esp32 dev

  • leonardo

  • lilypad

  • mega2560

  • micro

  • mkrzero

  • mkr1000

  • nano

  • nano every

  • nano 33 ble

  • nano rp2040 connect

  • promini

  • promicro

  • raspberry pi pico

  • sparkfunsamd21

  • uno wifi rev2

  • uno

Additional boards can usually be added with minimal code changes.

To add an additional board:

  1. The arduino core library (code programmed to the arduino) must provide a board id that is unique and matches the config id.

  2. The arduinoio.boardTypeString function must return the board name when provided the id.

  3. A config_<boardname>.m file must be present as arduinoio.config.config_<boardname>, which
    describes the pin functionality for the board.</boardname></boardname>

A Matlab script in available in arduino toolkit sources that to create 90% of the config file based
on the arduino_pins header file from the arduino ide.

Adding additional addon libraries

Addon libraries can be created using a similar interface as the Matlab toolkit, or use existing Matlab code with minor changes.

Known limitations and bugs

  1. Octave does not document classdef files, so documentation for the arduino class and arduinoio.LibraryBase is
    not created in the function reference, however is in the reference manual.

  2. Octave has issues with displaying function help after the classdef constructor is called, and may not show the
    help for a given function.

  3. Communication between the arduino and Octave occurs only during arduino function calls, so data may be lost if the arduino sends
    additional information that is not read fast enough.