Skip to content

Commit 6739f20

Browse files
committed
Modifying examples to use Serial.write() instead of Serial.print(BYTE).
1 parent e031022 commit 6739f20

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

build/shared/examples/4.Communication/ASCIITable/ASCIITable.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void loop()
3838
// prints value unaltered, i.e. the raw binary version of the
3939
// byte. The serial monitor interprets all bytes as
4040
// ASCII, so 33, the first number, will show up as '!'
41-
Serial.print(thisByte, BYTE);
41+
Serial.write(thisByte);
4242

4343
Serial.print(", dec: ");
4444
// prints value as string as an ASCII-encoded decimal (base 10).

build/shared/examples/4.Communication/MIDI/Midi.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ void loop() {
4242
// plays a MIDI note. Doesn't check to see that
4343
// cmd is greater than 127, or that data values are less than 127:
4444
void noteOn(int cmd, int pitch, int velocity) {
45-
Serial.print(cmd, BYTE);
46-
Serial.print(pitch, BYTE);
47-
Serial.print(velocity, BYTE);
45+
Serial.write(cmd);
46+
Serial.write(pitch);
47+
Serial.write(velocity);
4848
}
4949

build/shared/examples/4.Communication/MultiSerialMega/MultiSerialMega.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ void loop() {
2828
// read from port 1, send to port 0:
2929
if (Serial1.available()) {
3030
int inByte = Serial1.read();
31-
Serial.print(inByte, BYTE);
31+
Serial.write(inByte);
3232
}
3333
}

build/shared/examples/4.Communication/SerialCallResponse/SerialCallResponse.pde

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ void loop()
5252
// read switch, map it to 0 or 255L
5353
thirdSensor = map(digitalRead(2), 0, 1, 0, 255);
5454
// send sensor values:
55-
Serial.print(firstSensor, BYTE);
56-
Serial.print(secondSensor, BYTE);
57-
Serial.print(thirdSensor, BYTE);
55+
Serial.write(firstSensor);
56+
Serial.write(secondSensor);
57+
Serial.write(thirdSensor);
5858
}
5959
}
6060

6161
void establishContact() {
6262
while (Serial.available() <= 0) {
63-
Serial.print('A', BYTE); // send a capital A
63+
Serial.print('A'); // send a capital A
6464
delay(300);
6565
}
6666
}

libraries/Firmata/examples/EchoString/EchoString.pde

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ void stringCallback(char *myString)
1414

1515
void sysexCallback(byte command, byte argc, byte*argv)
1616
{
17-
Serial.print(START_SYSEX, BYTE);
18-
Serial.print(command, BYTE);
17+
Serial.write(START_SYSEX);
18+
Serial.write(command);
1919
for(byte i=0; i<argc; i++) {
20-
Serial.print(argv[i], BYTE);
20+
Serial.write(argv[i]);
2121
}
22-
Serial.print(END_SYSEX, BYTE);
22+
Serial.write(END_SYSEX);
2323
}
2424

2525
void setup()

libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void loop() {
7171
thisChar = 'a';
7272
}
7373
// print the character
74-
lcd.print(thisChar, BYTE);
74+
lcd.write(thisChar);
7575
// wait a second:
7676
delay(1000);
7777
// increment the letter:

libraries/LiquidCrystal/examples/setCursor/setCursor.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void loop() {
6161
// set the cursor position:
6262
lcd.setCursor(thisRow,thisCol);
6363
// print the letter:
64-
lcd.print(thisLetter, BYTE);
64+
lcd.write(thisLetter);
6565
delay(200);
6666
}
6767
}

0 commit comments

Comments
 (0)