mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Merge remote branch 'ricklon/platforms' into new-extension
This commit is contained in:
@ -217,6 +217,10 @@
|
||||
<exec executable="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" spawn="true"/>
|
||||
</target>
|
||||
|
||||
<target name="macosx-debug" depends="macosx-build" description="Run Mac OS X version">
|
||||
<exec executable="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" spawn="false"/>
|
||||
</target>
|
||||
|
||||
<target name="macosx-dist" if="macosx" depends="macosx-build" description="Create a .dmg of the Mac OS X version">
|
||||
<!-- now build the dmg -->
|
||||
<gunzip src="macosx/template.dmg.gz" dest="macosx/working.dmg" />
|
||||
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
Serial Event example
|
||||
|
||||
When new serial data arrives, this sketch adds it to a String.
|
||||
When a newline is received, the loop prints the string and
|
||||
clears it.
|
||||
|
||||
A good test for this is to try it with a GPS receiver
|
||||
that sends out NMEA 0183 sentences.
|
||||
|
||||
Created 9 May 2011
|
||||
by Tom Igoe
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/SerialEvent
|
||||
|
||||
*/
|
||||
|
||||
String inputString = ""; // a string to hold incoming data
|
||||
boolean stringComplete = false; // whether the string is complete
|
||||
|
||||
void setup() {
|
||||
// initialize serial:
|
||||
Serial.begin(9600);
|
||||
// reserve 200 bytes for the inputString:
|
||||
inputString.reserve(200);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// print the string when a newline arrives:
|
||||
if (stringComplete) {
|
||||
Serial.println(inputString);
|
||||
// clear the string:
|
||||
inputString = "";
|
||||
stringComplete = false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
SerialEvent occurs whenever a new byte comes in the
|
||||
hardware serial RX. Don't do complex things here, as thge
|
||||
processor halts the regular program to run this routine:
|
||||
*/
|
||||
void serialEvent() {
|
||||
// get the new byte:
|
||||
char inChar = (char)Serial.read();
|
||||
// add it to the inputString:
|
||||
inputString += inChar;
|
||||
// if the incoming character is a newline, set a flag
|
||||
// so the main loop can do something about it:
|
||||
if (inChar == '\n') {
|
||||
stringComplete = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -239,6 +239,8 @@ run.present.exclusive.macosx = true
|
||||
# ARDUINO PREFERENCES
|
||||
board = uno
|
||||
target = arduino
|
||||
platform = avr
|
||||
software=ARDUINO
|
||||
|
||||
programmer = arduino:avrispmkii
|
||||
|
||||
|
Reference in New Issue
Block a user