Errata
Page 157
change
Stepperbi stepper1=Stepperbi(); void loop() { stepper1.step(1); delay(10); }
to
Stepperbi stepper1=Stepperbi(16); void loop() { stepper1.step(1); delay(10); } void setup(){};
Page 254
Change
void setup() { Serial.begin(9600); Serial1.begin(9600, SERIAL_8N1, 2, 1); Serial1.setTimeout(30); } void loop() { char buffer[100]; Serial1.write("Hello World\n"); int len = Serial1.readBytes(buffer, 100); buffer[len] = NULL; Serial.printf("\nrecieved data: %s\n", buffer); while (true) {}; }
to
void setup() { Serial.begin(9600); Serial1.begin(9600, SERIAL_8N1, 2, 1); Serial1.setTimeout(30); } void loop() { char buffer[100]; Serial1.write("Hello World\n"); int len = Serial1.readBytes(buffer, 100); buffer[len] = NULL; Serial.printf("\nreceived data: %s\n", buffer); delay(1000); }
i.e. change the final loop for delay and correct spelling
Chapter 14
Use pins GPIO12 and GPIO13 for rx and tx rather than GPIO2 and GPIO3 thoughout - GPIO2 is a strapping pin
and sometimes changes the boot mode of the ESP32 on startup. Also connect GPIO12 to GPIO13 for loopback.
That is change:
Serial1.begin(9600, SERIAL_8N1, 2, 1);
to
Serial1.begin(9600, SERIAL_8N1, 12, 13);
Page 258, 259, 263, 274, 275, 281, 282, 284, 304, 307
Some ESP32 devices do not change baud rate from upload until loop is called.
This is a bug but a simple fix is to set the baud rate a second time and wait.
That is change
void setup() {
Serial.begin(9600);
to
void setup() {
Serial.begin(9600);
delay(2000);
Serial.begin(9600);
Page 283
Change
void wifiConnect(char* ssid, char* password) { WiFi.onEvent(WiFiEvent); status = WiFi.begin("ssid", "password"); }
to
void wifiConnect(char* ssid, char* password) { WiFi.onEvent(WiFiEvent); status = WiFi.begin(ssid, password); }
Remove quotes from ssid and password.
Page 347
Change
printf("%llX\n", count);
to
Serial.printf("%llX\n", count);
Page 351
Change
printf("%llX %d\n", data,uxQueueSpacesAvailable(q));
to
Serial.printf("%llX %d\n", data,uxQueueSpacesAvailable(q));