You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/Lecture0.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
## Introduction Projects
10
10
11
-
The Introduction projects should be completed before starting the OOP Mini Project. Ultimately, students should have a basic understanding of the following concepts: different sensors and actuators, wiring a breadboard, Unit Testing, and debugging software and hardware.
11
+
The Introduction projects should be completed before starting the OOP Mini Project. Ultimately, students should have a basic understanding of the following concepts: different sensors and actuators, wiring a breadboard, Unit Testing, and debugging both software and hardware.
12
12
13
13
|||
14
14
| --- | --- |
@@ -45,11 +45,10 @@ First students should copy the provided script [v02.py](..\project\py_scripts\v0
45
45
2. The buzzer should emit animated musical note on screen and if volume is turned up a constant tone.
46
46
3. The momentary switch should return `1` to the IDE terminal when closed (pressed) and 0 when not closed (depressed).
47
47
48
-
## Physical Wiring
49
-
48
+
## Physical Breadboard Protoytype
50
49
Watch the [Pi Pico Breadboard Introduction Video](https://www.youtube.com/watch?v=Ex7AJll-FsM). Students should wire their board, then unit test using the provided script [v02.py](..\project\py_scripts\v02.py).
Copy file name to clipboardExpand all lines: tutorials/Lecture1.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ The PWM Library provides an interface for controlling PWM signals on a specified
93
93
94
94
## Instantiation
95
95
96
-
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.
96
+
A class is like a blueprint for an object—it defines the attributes and methods the object will have, but it isn’t an actual object itself. Instantiation is the process of using the class to create a real, usable object in memory.
97
97
98
98
```python
99
99
from machine import Pin
@@ -112,9 +112,9 @@ while(True):
112
112
113
113
## Inheritance
114
114
115
-
Inheritance is a fundamental concept in object-oriented programming (OOP). It allows a class (called a child or subclass) to acquire properties and behaviours (methods and attributes) from another class (called a parent or superclass).
115
+
Inheritance is a fundamental concept in object-oriented programming (OOP). It allows a class (called a child or subclass) to inherit properties and behaviours (methods and attributes) from another class (called a parent or superclass).
116
116
117
-
In this case the Led_Light class inherits the Pin class and without any further instrcutions the sub class inherits and can call all the mthods of the super class including `on()`, `off()`, `high()`, `low()`, `toggle()`, etc.
117
+
In this case, the `Led_Light` class inherits from the Pin class, and without any further instructions, the subclass inherits and can call all the methods of the superclass, including `on()`, `off()`, `high()`, `low()`, `toggle()`, etc.
Copy file name to clipboardExpand all lines: tutorials/Lecture2.md
+4-9Lines changed: 4 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,6 @@
8
8
9
9
## UML Class Diagrams
10
10
11
-
What is a UML Class Diagram?
12
11
A UML (Unified Modelling Language) class diagram visually describes the structure of a system by showing its classes, their attributes (variables), methods (functions), and relationships (like inheritance).
13
12
14
13
```text
@@ -23,7 +22,7 @@ A UML (Unified Modelling Language) class diagram visually describes the structur
23
22
----------------------
24
23
```
25
24
26
-
Mermaid Markdown UML Class Diagram Example
25
+
### Mermaid Markdown UML Class Diagram Example
27
26
Below is a Mermaid class diagram for a Pi Pico GPIO Pin and a custom Led_Light class that inherits from it.
28
27
29
28
```mermaid
@@ -54,19 +53,17 @@ Explanation:
54
53
55
54
1. Class Name (Top Section): This is the uppermost part of the box. It displays the name of the class (e.g., Student, Order, Car).
56
55
2. Attributes (Middle Section): This section lists the attributes (or properties/fields) of the class. Each attribute is typically shown with its visibility (+ for public, - for private, # for protected), name, and type.
57
-
3. Methods/Operations (Bottom Section): This section lists the methods (or operations/functions) that belong to the class.
56
+
3. Methods (Bottom Section): This section lists the methods (or operations/functions) that belong to the class.
58
57
Each method is shown with its visibility, name, parameters, and return type.
59
58
4. Connections (lines and arrows): These lines and arrows represent relationships (such as inheritance, association, aggregation, and composition) between class boxes.
60
59
61
60
## Overriding Polymorphism
62
61
63
62
**Polymorphism means “many forms.”**
64
63
65
-
Overriding is when a child (subclass) provides a new implementation for a method that it inherits from its parent (superclass).
64
+
Polymorphism Overriding occurs when a child class (subclass) provides a new implementation for a method it inherits from its parent class (superclass).
66
65
67
-
The child class method has the same name and parameters as the method in the parent class. When you call the method on a child class object, Python (or any OOP language) uses the child’s version—even if the object is referenced by the parent type.
68
-
69
-
It is called 'overriding' or also compilation polymorphism, as in many languages like C++ or C#, the overridden (parent method) is not compiled at all.
66
+
The method in the child class has the same name and parameters as the one in the parent class. When the method is called on an object of the child class, Python (or any object-oriented language) uses the child’s version—even if the object is referenced using the parent type.
70
67
71
68
```python
72
69
from machine import Pin
@@ -172,8 +169,6 @@ Overloading occurs when a child (subclass) and/or parent (superclass) have multi
172
169
173
170
When you call the method, depending on the parameters passed, the corresponding method is executed.
174
171
175
-
It is called 'overloading' or also known as runtime polymorphism, as in many languages like C++ or C#, all the methods are compiled. However, depending on the parameters, the appropriate method is executed at runtime.
176
-
177
172
Because Python is dynamically typed, it does not support overloaded polymorphism, as the last definition of a method overwrites any previous ones.
Copy file name to clipboardExpand all lines: tutorials/Lecture3.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
- Complete led light class
9
9
10
10
## Encapsulation
11
-
Encapsulation restricts direct access to some of an object's components (attributes or methods), which means that the internal representation of an object is hidden from the outside. This is typically achieved by making certain attributes or methods private (i.e., not accessible from outside the class) and providing public methods (such as getters and setters) to access or modify those private members.
11
+
Encapsulation restricts direct access to some of an object's components (such as attributes or methods), meaning the internal representation of the object is hidden from the outside. This is typically achieved by making certain attributes or methods private (i.e., inaccessible from outside the class) and providing public methods (such as getters and setters) to access or modify those private members.
0 commit comments