File: README.md

package info (click to toggle)
octave-arduino 0.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,616 kB
  • sloc: cpp: 3,221; python: 438; makefile: 152; xml: 22; sh: 1
file content (138 lines) | stat: -rw-r--r-- 3,379 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<center>Octave Arduino Toolkit</center>
----------------------

---

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](https://www.arduino.cc/en/software) for programming the arduino board, 
and the [instrument-control toolkit](https://octave.sourceforge.io/instrument-control/index.html) 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

* nano esp32

* promini

* promicro

* raspberry pi pico

* sparkfunsamd21

* uno minima r4

* uno wifi rev2

* uno wifi r4

* 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.

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.