Skip to content

Commit 3397dac

Browse files
committed
* 'master' of https://github.com/arduino/Arduino: Corrected repeated 'less' in checkName's message Removed unused code, fixed indentation. Local (user installed) libraries have priority over system libraries Update README.md Added license for Client, IPAddressm and Server (master branch) Added license for Arduino.h, binary.h and main.cpp (master branch) Added some friendly messages for Arduino Robot include errors on old sketches Revert "Changed pins definition in variants from constants to #defines." Fixed issue arduino#1478, arduino#1599, arduino#1709, motors being opposite, updated turning algorithm If 2 libs have same .h file, use the lib with same dir name WiFi Shield examples: added the firmware version check Updated Listfiles SD example Rename README.mkdn to README.md Update and rename readme.txt to README.mkdn Update readme.txt Minor changes to Communication Examples
2 parents c553cfd + 2757691 commit 3397dac

File tree

77 files changed

+947
-1713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+947
-1713
lines changed

readme.txt renamed to README.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,44 @@
1-
Arduino is an open-source physical computing platform based on a simple i/o
1+
Arduino
2+
========
3+
4+
* Arduino is an open-source physical computing platform based on a simple i/o
25
board and a development environment that implements the Processing/Wiring
36
language. Arduino can be used to develop stand-alone interactive objects or
47
can be connected to software on your computer (e.g. Flash, Processing, MaxMSP).
58
The boards can be assembled by hand or purchased preassembled; the open-source
69
IDE can be downloaded for free.
710

8-
For more information, see the website at: http://www.arduino.cc/
11+
* For more information, see the website at: http://www.arduino.cc/
912
or the forums at: http://arduino.cc/forum/
1013

11-
To report a *bug* in the software or to request *a simple enhancement* go to:
14+
* To report a *bug* in the software or to request *a simple enhancement* go to:
1215
http://github.com/arduino/Arduino/issues
1316

14-
More complex requests and technical discussion should go on the Arduino Developers
17+
* More complex requests and technical discussion should go on the Arduino Developers
1518
mailing list:
1619
https://groups.google.com/a/arduino.cc/forum/#!forum/developers
1720

18-
If you're interested in modifying or extending the Arduino software, we strongly
21+
* If you're interested in modifying or extending the Arduino software, we strongly
1922
suggest discussing your ideas on the Developers mailing list *before* starting
2023
to work on them. That way you can coordinate with the Arduino Team and others,
2124
giving your work a higher chance of being integrated into the official release
2225
https://groups.google.com/a/arduino.cc/forum/#!forum/developers
2326

24-
INSTALLATION
27+
Installation
28+
------------
2529
Detailed instructions are in reference/Guide_Windows.html and
2630
reference/Guide_MacOSX.html. For Linux, see the Arduino playground:
2731
http://www.arduino.cc/playground/Learning/Linux
2832

29-
CREDITS
33+
Credits
34+
--------
3035
Arduino is an open source project, supported by many.
3136

3237
The Arduino team is composed of Massimo Banzi, David Cuartielles, Tom Igoe,
3338
Gianluca Martino, Daniela Antonietti, and David A. Mellis.
3439

35-
Arduino uses the GNU avr-gcc toolchain, avrdude, avr-libc, and code from
36-
Processing and Wiring.
40+
Arduino uses the [GNU avr-gcc toolchain](http://gcc.gnu.org/wiki/avr-gcc), [avrdude](http://www.nongnu.org/avrdude/), [avr-libc](http://www.nongnu.org/avr-libc/), and code from
41+
[Processing](http://www.processing.org) and [Wiring](http://wiring.org.co).
3742

3843
Icon and about image designed by ToDo: http://www.todo.to.it/
3944

app/src/processing/app/Base.java

+39-50
Original file line numberDiff line numberDiff line change
@@ -1211,62 +1211,51 @@ public void actionPerformed(ActionEvent event) {
12111211
boolean ifound = false;
12121212

12131213
for (String potentialName : list) {
1214-
File subfolder = new File(folder, potentialName);
1215-
// File libraryFolder = new File(subfolder, "library");
1216-
// File libraryJar = new File(libraryFolder, potentialName + ".jar");
1217-
// // If a .jar file of the same prefix as the folder exists
1218-
// // inside the 'library' subfolder of the sketch
1219-
// if (libraryJar.exists()) {
1220-
String sanityCheck = Sketch.sanitizeName(potentialName);
1221-
if (!sanityCheck.equals(potentialName)) {
1222-
String mess = I18n.format(
1223-
_("The library \"{0}\" cannot be used.\n" +
1224-
"Library names must contain only basic letters and numbers.\n" +
1225-
"(ASCII only and no spaces, and it cannot start with a number)"),
1226-
potentialName
1227-
);
1228-
Base.showMessage(_("Ignoring bad library name"), mess);
1229-
continue;
1230-
}
1214+
File libFolder = new File(folder, potentialName);
1215+
String sanityCheck = Sketch.sanitizeName(potentialName);
1216+
if (!sanityCheck.equals(potentialName)) {
1217+
String mess = I18n.format(_("The library \"{0}\" cannot be used.\n"
1218+
+ "Library names must contain only basic letters and numbers.\n"
1219+
+ "(ASCII only and no spaces, and it cannot start with a number)"),
1220+
potentialName);
1221+
Base.showMessage(_("Ignoring bad library name"), mess);
1222+
continue;
1223+
}
12311224

1232-
String libraryName = potentialName;
1233-
// // get the path for all .jar files in this code folder
1234-
// String libraryClassPath =
1235-
// Compiler.contentsToClassPath(libraryFolder);
1236-
// // grab all jars and classes from this folder,
1237-
// // and append them to the library classpath
1238-
// librariesClassPath +=
1239-
// File.pathSeparatorChar + libraryClassPath;
1240-
// // need to associate each import with a library folder
1241-
// String packages[] =
1242-
// Compiler.packageListFromClassPath(libraryClassPath);
1243-
libraries.add(subfolder);
1225+
String libraryName = potentialName;
1226+
libraries.add(libFolder);
1227+
String libFolderPath = libFolder.getAbsolutePath();
12441228
try {
1245-
String packages[] =
1246-
Compiler.headerListFromIncludePath(subfolder.getAbsolutePath());
1247-
for (String pkg : packages) {
1248-
importToLibraryTable.put(pkg, subfolder);
1229+
String headers[] = Compiler.headerListFromIncludePath(libFolderPath);
1230+
for (String header : headers) {
1231+
// Extract file name (without extension ".h")
1232+
String name = header.substring(0, header.length() - 2);
1233+
1234+
// If the header name equals to the current library folder use it
1235+
if (libFolderPath.endsWith(name)) {
1236+
importToLibraryTable.put(header, libFolder);
1237+
continue;
1238+
}
1239+
1240+
// If a library was already found with this header, keep it if
1241+
// the library's directory name matches the header name.
1242+
File old = importToLibraryTable.get(header);
1243+
if (old != null) {
1244+
if (old.getPath().endsWith(name))
1245+
continue;
1246+
}
1247+
importToLibraryTable.put(header, libFolder);
12491248
}
12501249
} catch (IOException e) {
1251-
showWarning(_("Error"), I18n.format("Unable to list header files in {0}", subfolder), e);
1250+
showWarning(_("Error"), I18n.format(
1251+
"Unable to list header files in {0}", libFolder), e);
12521252
}
12531253

1254-
JMenuItem item = new JMenuItem(libraryName);
1255-
item.addActionListener(listener);
1256-
item.setActionCommand(subfolder.getAbsolutePath());
1257-
menu.add(item);
1258-
ifound = true;
1259-
1260-
// XXX: DAM: should recurse here so that library folders can be nested
1261-
// } else { // not a library, but is still a folder, so recurse
1262-
// JMenu submenu = new JMenu(libraryName);
1263-
// // needs to be separate var, otherwise would set ifound to false
1264-
// boolean found = addLibraries(submenu, subfolder);
1265-
// if (found) {
1266-
// menu.add(submenu);
1267-
// ifound = true;
1268-
// }
1269-
// }
1254+
JMenuItem item = new JMenuItem(libraryName);
1255+
item.addActionListener(listener);
1256+
item.setActionCommand(libFolderPath);
1257+
menu.add(item);
1258+
ifound = true;
12701259
}
12711260
return ifound;
12721261
}

app/src/processing/app/Sketch.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ static public String checkName(String origName) {
20242024
String msg =
20252025
_("The sketch name had to be modified. Sketch names can only consist\n" +
20262026
"of ASCII characters and numbers (but cannot start with a number).\n" +
2027-
"They should also be less less than 64 characters long.");
2027+
"They should also be less than 64 characters long.");
20282028
System.out.println(msg);
20292029
}
20302030
return newName;

app/src/processing/app/debug/Compiler.java

+12
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,18 @@ public void message(String s) {
536536
}
537537
}
538538

539+
if (s.contains("undefined reference to `SPIClass::begin()'")
540+
&& s.contains("libraries/Robot_Control")) {
541+
String error = _("Please import the SPI library from the Sketch > Import Library menu.");
542+
exception = new RunnerException(error);
543+
}
544+
545+
if (s.contains("undefined reference to `Wire'")
546+
&& s.contains("libraries/Robot_Control")) {
547+
String error = _("Please import the Wire library from the Sketch > Import Library menu.");
548+
exception = new RunnerException(error);
549+
}
550+
539551
System.err.print(s);
540552
}
541553

build/shared/examples/04.Communication/Dimmer/Dimmer.ino

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ void loop() {
5555
size(256, 150);
5656
5757
println("Available serial ports:");
58+
// if using Processing 2.1 or later, use Serial.printArray()
5859
println(Serial.list());
5960
6061
// Uses the first port in this list (number 0). Change this to

build/shared/examples/04.Communication/Graph/Graph.ino

+4
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,17 @@ void loop() {
6363
size(400, 300);
6464
6565
// List all the available serial ports
66+
// if using Processing 2.1 or later, use Serial.printArray()
6667
println(Serial.list());
68+
6769
// I know that the first port in the serial list on my mac
6870
// is always my Arduino, so I open Serial.list()[0].
6971
// Open whatever port is the one you're using.
7072
myPort = new Serial(this, Serial.list()[0], 9600);
73+
7174
// don't generate a serialEvent() unless you get a newline character:
7275
myPort.bufferUntil('\n');
76+
7377
// set inital background:
7478
background(0);
7579
}

build/shared/examples/04.Communication/PhysicalPixel/PhysicalPixel.ino

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ void loop() {
8484
// You will need to choose the port that the Arduino board is
8585
// connected to from this list. The first port in the list is
8686
// port #0 and the third port in the list is port #2.
87+
// if using Processing 2.1 or later, use Serial.printArray()
8788
println(Serial.list());
8889
8990
// Open the port that the Arduino board is connected to (in this case #0)

build/shared/examples/04.Communication/SerialCallResponse/SerialCallResponse.ino

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ void setup() {
9292
xpos = width/2;
9393
ypos = height/2;
9494
95-
// Print a list of the serial ports, for debugging purposes:
95+
// Print a list of the serial ports for debugging purposes
96+
// if using Processing 2.1 or later, use Serial.printArray()
9697
println(Serial.list());
9798
9899
// I know that the first port in the serial list on my mac

build/shared/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ void setup() {
9191
size(640,480);
9292
9393
// List all the available serial ports
94+
// if using Processing 2.1 or later, use Serial.printArray()
9495
println(Serial.list());
9596
9697
// I know that the first port in the serial list on my mac

build/shared/examples/04.Communication/VirtualColorMixer/VirtualColorMixer.ino

+2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ void loop()
5050
size(200, 200);
5151
5252
// List all the available serial ports
53+
// if using Processing 2.1 or later, use Serial.printArray()
5354
println(Serial.list());
55+
5456
// I know that the first port in the serial list on my mac
5557
// is always my Arduino, so I open Serial.list()[0].
5658
// Open whatever port is the one you're using.

hardware/arduino/cores/arduino/Arduino.h

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
Arduino.h - Main include file for the Arduino SDK
3+
Copyright (c) 2005-2013 Arduino Team. All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
120
#ifndef Arduino_h
221
#define Arduino_h
322

hardware/arduino/cores/arduino/Client.h

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
Client.h - Base class that provides Client
3+
Copyright (c) 2011 Adrian McEwen. All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
120
#ifndef client_h
221
#define client_h
322
#include "Print.h"

hardware/arduino/cores/arduino/IPAddress.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
IPAddress.cpp - Base class that provides IPAddress
3+
Copyright (c) 2011 Adrian McEwen. All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
119

220
#include <Arduino.h>
321
#include <IPAddress.h>

hardware/arduino/cores/arduino/IPAddress.h

+17-23
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
/*
2-
*
3-
* MIT License:
4-
* Copyright (c) 2011 Adrian McEwen
5-
* Permission is hereby granted, free of charge, to any person obtaining a copy
6-
* of this software and associated documentation files (the "Software"), to deal
7-
* in the Software without restriction, including without limitation the rights
8-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
* copies of the Software, and to permit persons to whom the Software is
10-
* furnished to do so, subject to the following conditions:
11-
*
12-
* The above copyright notice and this permission notice shall be included in
13-
* all copies or substantial portions of the Software.
14-
*
15-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
* THE SOFTWARE.
22-
*
23-
* [email protected] 1/1/2011
24-
*/
2+
IPAddress.h - Base class that provides IPAddress
3+
Copyright (c) 2011 Adrian McEwen. All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
2519

2620
#ifndef IPAddress_h
2721
#define IPAddress_h

hardware/arduino/cores/arduino/Server.h

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
Server.h - Base class that provides Server
3+
Copyright (c) 2011 Adrian McEwen. All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
120
#ifndef server_h
221
#define server_h
322

0 commit comments

Comments
 (0)