mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
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
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@ -32,7 +32,7 @@ build/linux/libastylej*
|
|||||||
test-bin
|
test-bin
|
||||||
*.iml
|
*.iml
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
hardware/arduino/avr/libraries/Bridge/examples/XivelyClient/passwords.h
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
build/windows/launch4j-*
|
||||||
|
build/windows/launcher/launch4j
|
||||||
|
build/windows/WinAVR-*.zip
|
||||||
|
@ -2066,9 +2066,10 @@ public class Sketch {
|
|||||||
for (int i = 0; i < c.length; i++) {
|
for (int i = 0; i < c.length; i++) {
|
||||||
if (((c[i] >= '0') && (c[i] <= '9')) ||
|
if (((c[i] >= '0') && (c[i] <= '9')) ||
|
||||||
((c[i] >= 'a') && (c[i] <= 'z')) ||
|
((c[i] >= 'a') && (c[i] <= 'z')) ||
|
||||||
((c[i] >= 'A') && (c[i] <= 'Z'))) {
|
((c[i] >= 'A') && (c[i] <= 'Z')) ||
|
||||||
|
((i > 0) && (c[i] == '-')) ||
|
||||||
|
((i > 0) && (c[i] == '.'))) {
|
||||||
buffer.append(c[i]);
|
buffer.append(c[i]);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
buffer.append('_');
|
buffer.append('_');
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ public class SketchCode {
|
|||||||
|
|
||||||
protected void makePrettyName() {
|
protected void makePrettyName() {
|
||||||
prettyName = file.getName();
|
prettyName = file.getName();
|
||||||
int dot = prettyName.indexOf('.');
|
int dot = prettyName.lastIndexOf('.');
|
||||||
prettyName = prettyName.substring(0, dot);
|
prettyName = prettyName.substring(0, dot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
<equals arg1="${platform}" arg2="linux64"/>
|
<equals arg1="${platform}" arg2="linux64"/>
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
|
<condition property="launch4j-download-unpack-target-name" value="launch4j-windows"><os family="windows" /></condition>
|
||||||
|
<property name="launch4j-download-unpack-target-name" value="launch4j-linux"/>
|
||||||
|
|
||||||
<!-- Libraries required for running arduino -->
|
<!-- Libraries required for running arduino -->
|
||||||
<fileset dir=".." id="runtime.jars">
|
<fileset dir=".." id="runtime.jars">
|
||||||
<include name="core/core.jar" />
|
<include name="core/core.jar" />
|
||||||
@ -654,6 +657,7 @@
|
|||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="windows-build"
|
<target name="windows-build"
|
||||||
|
depends="revision-check, windows-checkos, subprojects-build"
|
||||||
depends="revision-check, windows-checkos, subprojects-build"
|
depends="revision-check, windows-checkos, subprojects-build"
|
||||||
description="Build windows version">
|
description="Build windows version">
|
||||||
<mkdir dir="windows/work" />
|
<mkdir dir="windows/work" />
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
|
|
||||||
Created on 22 Dec 2012
|
Created on 22 Dec 2012
|
||||||
by Tom Igoe
|
by Tom Igoe
|
||||||
|
Updated 8 March 2014
|
||||||
|
by Scott Fitzgerald
|
||||||
|
|
||||||
|
http://arduino.cc/en/Reference/EsploraReadJoystickSwitch
|
||||||
|
|
||||||
This example is in the public domain.
|
This example is in the public domain.
|
||||||
*/
|
*/
|
||||||
@ -41,10 +45,16 @@ void loop()
|
|||||||
Serial.print("\tButton: "); // print a tab character and a label for the button
|
Serial.print("\tButton: "); // print a tab character and a label for the button
|
||||||
Serial.print(button); // print the button value
|
Serial.print(button); // print the button value
|
||||||
|
|
||||||
int mouseX = map( xValue, -512, 512, 10, -10); // map the X value to a range of movement for the mouse X
|
int mouseX = map(xValue, -512, 512, 10, -10); // map the X value to a range of movement for the mouse X
|
||||||
int mouseY = map( yValue, -512, 512, -10, 10); // map the Y value to a range of movement for the mouse Y
|
int mouseY = map(yValue, -512, 512, -10, 10); // map the Y value to a range of movement for the mouse Y
|
||||||
Mouse.move(mouseX, mouseY, 0); // move the mouse
|
Mouse.move(mouseX, mouseY, 0); // move the mouse
|
||||||
|
|
||||||
|
if (button == 0) { // if the joystick button is pressed
|
||||||
|
Mouse.press(); // send a mouse click
|
||||||
|
} else {
|
||||||
|
Mouse.release(); // if it's not pressed, release the mouse button
|
||||||
|
}
|
||||||
|
|
||||||
delay(10); // a short delay before moving again
|
delay(10); // a short delay before moving again
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user