Skip to content

Commit 0dda5d7

Browse files
Update Lecture1.md
1 parent 40f4a6c commit 0dda5d7

1 file changed

Lines changed: 22 additions & 21 deletions

File tree

tutorials/Lecture1.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
# Lecture 1
22

33
## Lecture 1 Concepts
4-
- Pin & PWM Parent Classes
54
- Unit Testing
65
- Parent/Child Class
6+
- Generalisation
7+
- Pin & PWM Parent Classes
78
- Instantiation
89
- Inheritance
9-
- Generalisation
10-
11-
## Pin Library
12-
13-
[Machine.Pin Library Documentation](https://docs.micropython.org/en/latest/library/machine.Pin.html)
14-
15-
The Pin library in MicroPython for the Pi Pico allows you to control the General Purpose Input/Output (GPIO) pins of the Pico. It allows you to configure pins as digital (binary) inputs or outputs.
16-
17-
## PWM Library
18-
19-
[Machine.Pin Library Documentation](https://docs.micropython.org/en/latest/library/machine.PWM.html)
20-
21-
The PWM Library provides an interface for controlling PWM signals on a specified GPIO pin. It allows you to configure any GPIO pin as a PWM and set the duty cycle and frequency.
2210

2311
## Unit Testing
2412

@@ -39,6 +27,8 @@ classDiagram
3927
+value()
4028
+high()
4129
+low()
30+
+high()
31+
+low()
4232
+toggle()
4333
}
4434
@@ -65,10 +55,9 @@ classDiagram
6555
+__init__(pin: int, flashing: bool, debug: bool)
6656
+on()
6757
+off()
58+
+high()
59+
+Low
6860
+toggle()
69-
+flash(duration: int)
70-
+on_for(duration: int)
71-
+led_light_state: int
7261
}
7362
Pin <|-- Led_Light : Inheritance
7463
@@ -86,6 +75,22 @@ classDiagram
8675
8776
```
8877

78+
## Generalisation
79+
80+
On the Pi Pico, the Pin and PWM libraries are designed to be generalised to provide flexible and reusable interfaces for interacting with the microcontroller’s hardware. The simple `on()`, `off()` or `high()`, `low()` methods are not specific to any hardware but are generalised to the nature of a digital GPIO Pin. As a generalised class is inherited and the classes are extended, they become more specific (less generalised) and functional to specific hardware for which they are designed.
81+
82+
## Pin Library
83+
84+
[Machine.Pin Library Documentation](https://docs.micropython.org/en/latest/library/machine.Pin.html)
85+
86+
The Pin library in MicroPython for the Pi Pico allows you to control the General Purpose Input/Output (GPIO) pins of the Pico. It allows you to configure pins as digital (binary) inputs or outputs.
87+
88+
## PWM Library
89+
90+
[Machine.Pin Library Documentation](https://docs.micropython.org/en/latest/library/machine.PWM.html)
91+
92+
The PWM Library provides an interface for controlling PWM signals on a specified GPIO pin. It allows you to configure any GPIO pin as a PWM and set the duty cycle and frequency.
93+
8994
## Instantiation
9095

9196
A class is like a blueprint for an object—it defines what attributes and methods the object will have, but by itself, it isn’t an actual object. Instantiation is when you use the class to create an actual, usable object in memory.
@@ -137,7 +142,3 @@ while True:
137142
red_light.toggle()
138143
sleep(4)
139144
```
140-
141-
## Generalisation
142-
143-
On the Pi Pico, the Pin and PWM libraries are designed to be generalised to provide flexible and reusable interfaces for interacting with the microcontroller’s hardware. The simple `on()`, `off()` or `high()`, `low()` methods are not specific to any hardware but are generalised to the nature of a digital GPIO Pin. As a generalised class is inherited and the classes are extended, they become more specific (less generalised) and functional to specific hardware for which they are designed.

0 commit comments

Comments
 (0)