Skip to content

Commit 738b9d8

Browse files
committed
Merge remote-tracking branch 'arduino/master' into ide-1.5.x
Conflicts: .gitignore app/lib/commons-logging-1.0.4.jar build/build.xml build/windows/launcher/config_debug.xml libraries/Esplora/examples/Beginners/EsploraJoystickMouse/EsploraJoystickMouse.ino
2 parents 4672eee + 9810e89 commit 738b9d8

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ build/linux/libastylej*
3232
test-bin
3333
*.iml
3434
.idea
35-
36-
hardware/arduino/avr/libraries/Bridge/examples/XivelyClient/passwords.h
3735
.DS_Store
38-
36+
build/windows/launch4j-*
37+
build/windows/launcher/launch4j
38+
build/windows/WinAVR-*.zip

app/src/processing/app/Sketch.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -2066,9 +2066,10 @@ static public String sanitizeName(String origName) {
20662066
for (int i = 0; i < c.length; i++) {
20672067
if (((c[i] >= '0') && (c[i] <= '9')) ||
20682068
((c[i] >= 'a') && (c[i] <= 'z')) ||
2069-
((c[i] >= 'A') && (c[i] <= 'Z'))) {
2069+
((c[i] >= 'A') && (c[i] <= 'Z')) ||
2070+
((i > 0) && (c[i] == '-')) ||
2071+
((i > 0) && (c[i] == '.'))) {
20702072
buffer.append(c[i]);
2071-
20722073
} else {
20732074
buffer.append('_');
20742075
}

app/src/processing/app/SketchCode.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public SketchCode(File file, String extension) {
8787

8888
protected void makePrettyName() {
8989
prettyName = file.getName();
90-
int dot = prettyName.indexOf('.');
90+
int dot = prettyName.lastIndexOf('.');
9191
prettyName = prettyName.substring(0, dot);
9292
}
9393

build/build.xml

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
<equals arg1="${platform}" arg2="linux64"/>
3838
</condition>
3939

40+
<condition property="launch4j-download-unpack-target-name" value="launch4j-windows"><os family="windows" /></condition>
41+
<property name="launch4j-download-unpack-target-name" value="launch4j-linux"/>
42+
4043
<!-- Libraries required for running arduino -->
4144
<fileset dir=".." id="runtime.jars">
4245
<include name="core/core.jar" />
@@ -655,6 +658,7 @@
655658

656659
<target name="windows-build"
657660
depends="revision-check, windows-checkos, subprojects-build"
661+
depends="revision-check, windows-checkos, subprojects-build"
658662
description="Build windows version">
659663
<mkdir dir="windows/work" />
660664

libraries/Esplora/examples/Beginners/EsploraJoystickMouse/EsploraJoystickMouse.ino

+12-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
1818
Created on 22 Dec 2012
1919
by Tom Igoe
20+
Updated 8 March 2014
21+
by Scott Fitzgerald
22+
23+
http://arduino.cc/en/Reference/EsploraReadJoystickSwitch
2024
2125
This example is in the public domain.
2226
*/
@@ -41,10 +45,16 @@ void loop()
4145
Serial.print("\tButton: "); // print a tab character and a label for the button
4246
Serial.print(button); // print the button value
4347

44-
int mouseX = map( xValue, -512, 512, 10, -10); // map the X value to a range of movement for the mouse X
45-
int mouseY = map( yValue, -512, 512, -10, 10); // map the Y value to a range of movement for the mouse Y
48+
int mouseX = map(xValue, -512, 512, 10, -10); // map the X value to a range of movement for the mouse X
49+
int mouseY = map(yValue, -512, 512, -10, 10); // map the Y value to a range of movement for the mouse Y
4650
Mouse.move(mouseX, mouseY, 0); // move the mouse
4751

52+
if (button == 0) { // if the joystick button is pressed
53+
Mouse.press(); // send a mouse click
54+
} else {
55+
Mouse.release(); // if it's not pressed, release the mouse button
56+
}
57+
4858
delay(10); // a short delay before moving again
4959
}
5060

0 commit comments

Comments
 (0)