source: rtos_arduino/trunk/arduino_lib/libraries/Firmata/readme.md@ 224

Last change on this file since 224 was 224, checked in by ertl-honda, 8 years ago

1.7.10のファイルに更新

File size: 9.8 KB
Line 
1#Firmata
2
3[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/firmata/arduino?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
5Firmata is a protocol for communicating with microcontrollers from software on a host computer. The [protocol](https://github.com/firmata/protocol) can be implemented in firmware on any microcontroller architecture as well as software on any host computer software package. The Arduino repository described here is a Firmata library for Arduino and Arduino-compatible devices. If you would like to contribute to Firmata, please see the [Contributing](#contributing) section below.
6
7##Usage
8
9There are two main models of usage of Firmata. In one model, the author of the Arduino sketch uses the various methods provided by the Firmata library to selectively send and receive data between the Arduino device and the software running on the host computer. For example, a user can send analog data to the host using ``` Firmata.sendAnalog(analogPin, analogRead(analogPin)) ``` or send data packed in a string using ``` Firmata.sendString(stringToSend) ```. See File -> Examples -> Firmata -> AnalogFirmata & EchoString respectively for examples.
10
11The second and more common model is to load a general purpose sketch called StandardFirmata (or one of the variants such as StandardFirmataPlus or StandardFirmataEthernet depending on your needs) on the Arduino board and then use the host computer exclusively to interact with the Arduino board. StandardFirmata is located in the Arduino IDE in File -> Examples -> Firmata.
12
13##Firmata Client Libraries
14Most of the time you will be interacting with Arduino with a client library on the host computers. Several Firmata client libraries have been implemented in a variety of popular programming languages:
15
16* processing
17 * [https://github.com/firmata/processing]
18 * [http://funnel.cc]
19* python
20 * [https://github.com/MrYsLab/pymata-aio]
21 * [https://github.com/MrYsLab/PyMata]
22 * [https://github.com/tino/pyFirmata]
23 * [https://github.com/lupeke/python-firmata]
24 * [https://github.com/firmata/pyduino]
25* perl
26 * [https://github.com/ntruchsess/perl-firmata]
27 * [https://github.com/rcaputo/rx-firmata]
28* ruby
29 * [https://github.com/hardbap/firmata]
30 * [https://github.com/PlasticLizard/rufinol]
31 * [http://funnel.cc]
32* clojure
33 * [https://github.com/nakkaya/clodiuno]
34 * [https://github.com/peterschwarz/clj-firmata]
35* javascript
36 * [https://github.com/jgautier/firmata]
37 * [https://github.com/rwldrn/johnny-five]
38 * [http://breakoutjs.com]
39* java
40 * [https://github.com/kurbatov/firmata4j]
41 * [https://github.com/4ntoine/Firmata]
42 * [https://github.com/reapzor/FiloFirmata]
43* .NET
44 * [https://github.com/SolidSoils/Arduino]
45 * [http://www.imagitronics.org/projects/firmatanet/]
46* Flash/AS3
47 * [http://funnel.cc]
48 * [http://code.google.com/p/as3glue/]
49* PHP
50 * [https://bitbucket.org/ThomasWeinert/carica-firmata]
51 * [https://github.com/oasynnoum/phpmake_firmata]
52* Haskell
53 * [http://hackage.haskell.org/package/hArduino]
54* iOS
55 * [https://github.com/jacobrosenthal/iosfirmata]
56* Dart
57 * [https://github.com/nfrancois/firmata]
58* Max/MSP
59 * [http://www.maxuino.org/]
60* Elixir
61 * [https://github.com/kfatehi/firmata]
62* Modelica
63 * [https://www.wolfram.com/system-modeler/libraries/model-plug/]
64* golang
65 * [https://github.com/kraman/go-firmata]
66
67Note: The above libraries may support various versions of the Firmata protocol and therefore may not support all features of the latest Firmata spec nor all Arduino and Arduino-compatible boards. Refer to the respective projects for details.
68
69##Updating Firmata in the Arduino IDE - Arduino 1.6.4 and higher
70
71If you want to update to the latest stable version:
72
731. Open the Arduino IDE and navigate to: `Sketch > Include Library > Manage Libraries`
742. Filter by "Firmata" and click on the "Firmata by Firmata Developers" item in the list of results.
753. Click the `Select version` dropdown and select the most recent version (note you can also install previous versions)
764. Click `Install`.
77
78###Cloning Firmata
79
80If you are contributing to Firmata or otherwise need a version newer than the latest tagged release, you can clone Firmata directly to your Arduino/libraries/ directory (where 3rd party libraries are installed). This only works for Arduino 1.6.4 and higher, for older versions you need to clone into the Arduino application directory (see section below titled "Using the Source code rather than release archive"). Be sure to change the name to Firmata as follows:
81
82```bash
83$ git clone git@github.com:firmata/arduino.git ~/Documents/Arduino/libraries/Firmata
84```
85
86*Update path above if you're using Windows or Linux or changed the default Arduino directory on OS X*
87
88
89##Updating Firmata in the Arduino IDE - older versions (<= 1.6.3 or 1.0.x)
90
91Download the latest [release](https://github.com/firmata/arduino/releases/tag/2.5.2) (for Arduino 1.0.x or Arduino 1.5.6 or higher) and replace the existing Firmata folder in your Arduino application. See the instructions below for your platform.
92
93*Note that Arduino 1.5.0 - 1.5.5 are not supported. Please use Arduino 1.5.6 or higher (or Arduino 1.0.5 or 1.0.6).*
94
95###Mac OSX:
96
97The Firmata library is contained within the Arduino package.
98
991. Navigate to the Arduino application
1002. Right click on the application icon and select `Show Package Contents`
1013. Navigate to: `/Contents/Resources/Java/libraries/` and replace the existing
102`Firmata` folder with latest [Firmata release](https://github.com/firmata/arduino/releases/tag/2.5.2) (note there is a different download
103for Arduino 1.0.x vs 1.6.x)
1044. Restart the Arduino application and the latest version of Firmata will be available.
105
106*If you are using the Java 7 version of Arduino 1.5.7 or higher, the file path
107will differ slightly: `Contents/Java/libraries/Firmata` (no Resources directory).*
108
109###Windows:
110
1111. Navigate to `c:/Program\ Files/arduino-1.x/libraries/` and replace the existing
112`Firmata` folder with the latest [Firmata release](https://github.com/firmata/arduino/releases/tag/2.5.2) (note there is a different download
113for Arduino 1.0.x vs 1.6.x).
1142. Restart the Arduino application and the latest version of Firmata will be available.
115
116*Update the path and Arduino version as necessary*
117
118###Linux:
119
1201. Navigate to `~/arduino-1.x/libraries/` and replace the existing
121`Firmata` folder with the latest [Firmata release](https://github.com/firmata/arduino/releases/tag/2.5.2) (note there is a different download
122for Arduino 1.0.x vs 1.6.x).
1232. Restart the Arduino application and the latest version of Firmata will be available.
124
125*Update the path and Arduino version as necessary*
126
127###Using the Source code rather than release archive (only for versions older than Arduino 1.6.3)
128
129*It is recommended you update to Arduino 1.6.4 or higher if possible, that way you can clone directly into the external Arduino/libraries/ directory which persists between Arduino application updates. Otherwise you will need to move your clone each time you update to a newer version of the Arduino IDE.*
130
131If you're stuck with an older version of the IDE, then follow these keep reading otherwise jump up to the "Cloning Firmata section above".
132
133Clone this repo directly into the core Arduino application libraries directory. If you are using
134Arduino 1.5.x or <= 1.6.3, the repo directory structure will not match the Arduino
135library format, however it should still compile as long as you are using Arduino 1.5.7
136or higher.
137
138You will first need to remove the existing Firmata library, then clone firmata/arduino
139into an empty Firmata directory:
140
141```bash
142$ rm -r /Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata
143$ git clone git@github.com:firmata/arduino.git /Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata
144```
145
146*Update paths if you're using Windows or Linux*
147
148To generate properly formatted versions of Firmata (for Arduino 1.0.x and Arduino 1.6.x), run the
149`release.sh` script.
150
151
152<a name="contributing" />
153##Contributing
154
155If you discover a bug or would like to propose a new feature, please open a new [issue](https://github.com/firmata/arduino/issues?sort=created&state=open). Due to the limited memory of standard Arduino boards we cannot add every requested feature to StandardFirmata. Requests to add new features to StandardFirmata will be evaluated by the Firmata developers. However it is still possible to add new features to other Firmata implementations (Firmata is a protocol whereas StandardFirmata is just one of many possible implementations).
156
157To contribute, fork this repository and create a new topic branch for the bug, feature or other existing issue you are addressing. Submit the pull request against the *master* branch.
158
159If you would like to contribute but don't have a specific bugfix or new feature to contribute, you can take on an existing issue, see issues labeled "pull-request-encouraged". Add a comment to the issue to express your intent to begin work and/or to get any additional information about the issue.
160
161You must thoroughly test your contributed code. In your pull request, describe tests performed to ensure that no existing code is broken and that any changes maintain backwards compatibility with the existing api. Test on multiple Arduino board variants if possible. We hope to enable some form of automated (or at least semi-automated) testing in the future, but for now any tests will need to be executed manually by the contributor and reviewers.
162
163Use [Artistic Style](http://astyle.sourceforge.net/) (astyle) to format your code. Set the following rules for the astyle formatter:
164
165```
166style = ""
167indent-spaces = 2
168indent-classes = true
169indent-switches = true
170indent-cases = true
171indent-col1-comments = true
172pad-oper = true
173pad-header = true
174keep-one-line-statements = true
175```
176
177If you happen to use Sublime Text, [this astyle plugin](https://github.com/timonwong/SublimeAStyleFormatter) is helpful. Set the above rules in the user settings file.
Note: See TracBrowser for help on using the repository browser.