Page 61

As the internal pull-down resistor is used, the switch can be connected to the line and ground without any external resistors:

should read:

As the internal pull-up resistor is used, the switch can be connected to the line and ground without any external resistors:

 

Page 131

The line in the first new paragraph:

The PWM output in this configuration mimics the workings of an 8-bit A-to-D converter.

shoudl read:

The PWM output in this configuration mimics the workings of an 8-bit D-to-A converter.

i.e. swap A and D.

 

 

Page 135

The graph axis labels need to be switched.

Printing 0

 

Page 61

The use of PULL_UP and PULL_DOWN has been reversed.

The correct text is:

The simplest switch input program using an internal pull-up is:

from machine import Pin
import time
pinIn = Pin(22, Pin.IN,Pin.PULL_UP)
pinLED = Pin(25, Pin.OUT)

while True:
    if pinIn.value():
        pinLED.on()
    else:
        pinLED.off()
    time.sleep(0.5)


As the internal pull-up resistor is used, the switch can be connected to the line and ground without any external resistors:

and

If you change PULL_UP to PULL_DOWN, the way the switch is connected becomes:

Page 101

The graph axis labels need to be switched.

 

Page 71

The if statements if edge should be changed to if edge==1 to avoid firing on both the rising and falling edge of the switch. That is, change:

    if s==0:
        if edge:
            s=1
            pinLED1.off()
            pinLED2.on()
            pinLED3.off()
    
    elif s==1:
        if edge:
            s=2
            pinLED1.off()
            pinLED2.off()
            pinLED3.on()
    elif s==2:
        if edge:
            s=0
            pinLED1.on()
            pinLED2.off()
            pinLED3.off()

to read:

    if s==0:
        if edge==1:
            s=1
            pinLED1.off()
            pinLED2.on()
            pinLED3.off()
    
    elif s==1:
        if edge==1:
            s=2
            pinLED1.off()
            pinLED2.off()
            pinLED3.on()
    elif s==2:
        if edge==1:
            s=0
            pinLED1.on()
            pinLED2.off()
            pinLED3.off()

 

Page 97

final sentence of penultimate paragraph:

The PWM output in this configuration mimics the workings of an 8-bit A-to-D converter.

should read:

The PWM output in this configuration mimics the workings of an 8-bit D-to-A converter.