Errata


Print Print Icon

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.


Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question



Version Location Description Submitted By
Printed Page 69
Entire page

Tom Igoe submitted these changes to improve the behavior of the program:

p69, second >> box (text and facing code):

1) Delete the paragraph beginning with "Add a loop..." and ending with "three sensor readings."
2) Delete the facing code ("while (Serial.available"...)
3) Move the paragraph "Next, add some..." to the box above so it appears after the paragraph ending "...like this:"
4) This >> box should now be empty. Delete it.

p69, first >> box (text):

1) Change "To make this happen, first" to "Next,"

p69, add a new >> box at the top of the page (text and facing code):

1) Text: "To make this happen, first add the following lines to the startup() of the Arduino program. This makes the Arduino send out a serial message until it gets a response from Processing:"
2) Code:
while (Serial.available() <= 0) {
Serial.println("hello"); // send a starting message
delay(300);
}

p69, last >> box (code)
1) Delete only the following lines:
// if serialEvent occurs at all, contact with the microcontroller
// has been made:
if (madeContact == false) {
myPort.clear(); // clear the serial port buffer
madeContact = true;
myPort.write('\r');
}
2) Add the following line after the third line in this listing:
myString = trim(myString);
3) After the line reading "if (myString != null) {", replace "myString = trim(myString);" with the following:
// if you haven't heard from the microcontroller yet, listen:
if ( madeContact == false) {
if (myString.equals("hello")) {
myPort.clear(); // clear the serial port buffer
madeContact = true; // you've made contact with the microcontroller
myPort.write('\r'); // ask for more
}
}

4) If the correct lines have been deleted/added, these will be the first 15 lines in the program:
void serialEvent(Serial myPort) {
// read the serial buffer:
String myString = myPort.readStringUntil(linefeed);
myString = trim(myString);

// if you got any bytes other than the linefeed:
if (myString != null) {
// if you haven't heard from the microcontroller yet, listen:
if ( madeContact == false) {
if (myString.equals("hello")) {
myPort.clear(); // clear the serial port buffer
madeContact = true; // you've made contact with the microcontroller
myPort.write('\r'); // ask for more
}
}

Brian Jepson
Brian Jepson
O'Reilly AuthorO'Reilly Blogger 


"I really enjoyed this; so much so that I immediately bought a Wiring.org microcontroller and got my first "blinking lights" working last night. If this lights a fire in you as it did in me, you'll want this book, and you'll also want to visit the MAKE Website and perhaps subscribe to MAKE Magazine also."
--Tony Lawrence, AP Lawrence: Information and Resources for Unix and Linux Systems