Skip to content

Commit 9f6e15a

Browse files
committed
Fix circuit pins
1 parent 6cfa781 commit 9f6e15a

22 files changed

+15
-13
lines changed

content/micropython-course/course/04.digital/03.digital.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ For the LED, we can do sort of the reverse: we can write a HIGH / LOW state to i
3030

3131
In this exercise, we will read a button, which we will need to connect to our Nano ESP32 board, following the circuit diagram below:
3232

33-
![Button Circuit.](assets/button.png)
33+
![Button Circuit.](assets/circuitButton.png)
3434

3535
Open the code editor, and copy paste the following script to the `main.py` file, then click on the **"Run"** button to run it.
3636

3737
```python
3838
from machine import Pin
3939
import time
4040

41-
button = Pin(5, Pin.IN, Pin.PULL_UP)
41+
button = Pin(9, Pin.IN, Pin.PULL_UP)
4242

4343
while True:
4444
print(button.value())
@@ -57,7 +57,7 @@ We have now successfully read the state of a button, one of the world's most com
5757

5858
In the next exercise, we will turn on an LED, which we will need to connect to our Nano ESP32 board, following the circuit diagram below:
5959

60-
![LED circuit.](assets/led.png)
60+
![LED circuit.](assets/circuitLED.png)
6161

6262
Open the code editor, and copy paste the following script to the `main.py` file, then click on the **"Run"** button to run it.
6363

Binary file not shown.
Loading
Loading
Binary file not shown.

content/micropython-course/course/05.analog/04.analog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ In the next exercise, we will add an LED to our circuit, which we will control w
7575

7676
Follow the circuit diagram below to add the LED to the circuit.
7777

78-
![LED + pot circuit](assets/potledcircuit.png)
78+
![LED + pot circuit](assets/circuitPotLed.png)
7979

8080
Open the code editor, and copy paste the following script to the `main.py` file, then click on the **Run"** button to run it.
8181

Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[LocalizedFileNames]
2+
circuitPotLed.png=@circuitPotLed,0
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

content/micropython-course/course/08.examples/examples.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ from machine import Pin
6969
from time import sleep
7070

7171
# Create a Pin object for pin 5 as an input with a pull-up resistor
72-
button = Pin(5, Pin.IN, Pin.PULL_UP)
72+
button = Pin(9, Pin.IN, Pin.PULL_UP)
7373

7474
# Start an infinite loop
7575
while True:
@@ -107,7 +107,7 @@ from machine import Pin
107107
from time import sleep
108108

109109
# Create a Pin object for pin 5 as an output
110-
led = Pin(5, Pin.OUT)
110+
led = Pin(9, Pin.OUT)
111111

112112
# Start an infinite loop
113113
while True:
@@ -144,7 +144,7 @@ from machine import Pin, PWM
144144
import time
145145

146146
# Create a PWM object named 'servo' on pin 5 configured as an output
147-
servo = PWM(Pin(5, mode=Pin.OUT))
147+
servo = PWM(Pin(9, mode=Pin.OUT))
148148
# Set the frequency of the PWM signal to 50Hz
149149
servo.freq(50)
150150

@@ -185,7 +185,7 @@ import neopixel
185185
# Set the number of pixel on the RGB strip
186186
PIXEL_NUMBER = 10
187187
# Create a NeoPixel object with 24 pixels connected to pin 21
188-
np = neopixel.NeoPixel(Pin(21), PIXEL_NUMBER)
188+
np = neopixel.NeoPixel(Pin(9), PIXEL_NUMBER)
189189

190190
# Define colors
191191
purple = (200, 0, 200)
@@ -253,7 +253,7 @@ from machine import Pin
253253
from time import sleep_ms
254254

255255
# Define sensor pin
256-
SENSOR_PIN = 5
256+
SENSOR_PIN = 9
257257

258258
# Create a DHT11 object with the specified pin number
259259
TEMP_SENSOR = dht.DHT11(Pin(SENSOR_PIN))
@@ -355,7 +355,7 @@ from machine import Pin, PWM
355355
import time
356356

357357
# Pin connected to the Grove Speaker
358-
SPEAKER_PIN = 5
358+
SPEAKER_PIN = 9
359359

360360
# Frequency and duration of the sound
361361
FREQUENCY = 220 # Hz
@@ -397,7 +397,7 @@ import lis3dh, time, math
397397
# Import Pin and SoftI2C class from the machine module
398398
from machine import Pin, SoftI2C
399399

400-
i2c = SoftI2C(sda=Pin(11), scl=Pin(12)) # I2C
400+
i2c = SoftI2C(scl=Pin(12), sda=Pin(11)) # I2C
401401
imu = lis3dh.LIS3DH_I2C(i2c, address=0x19)
402402

403403
last_convert_time = 0
@@ -465,7 +465,7 @@ from machine import Pin, ADC
465465
import time
466466

467467
# Create an ADC object and associate it with pin 5
468-
pin_adc = ADC(Pin(5))
468+
pin_adc = ADC(Pin(9))
469469
# Set the attenuation level to 11dB, which allows for a wider input voltage range
470470
pin_adc.atten(ADC.ATTN_11DB)
471471

@@ -512,7 +512,7 @@ from machine import Pin
512512
from time import sleep
513513
import tm1637
514514

515-
tm = tm1637.TM1637(clk=Pin(10), dio=Pin(11))
515+
tm = tm1637.TM1637(clk=Pin(12), dio=Pin(11))
516516

517517
tm.write([63, 191, 63, 63]) # Write a specific pattern of segments to the TM1637 display
518518
sleep(1)

0 commit comments

Comments
 (0)