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/Lecture3.md
+66-4Lines changed: 66 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
- Abstraction
7
7
- Extend LED functionality
8
8
- Complete led light class
9
+
- Unit test the led light class
9
10
10
11
## Encapsulation
11
12
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.
@@ -178,6 +179,67 @@ while True:
178
179
- The LED should be wired with an appropriate resistor to the specified GPIO pin.
179
180
- The class uses the internal features of the `machine.Pin` class for output control.
180
181
182
+
### Class Unit Test
183
+
184
+
```python
185
+
from time import sleep
186
+
from led_light import Led_Light
187
+
188
+
# Replace 3 with a valid GPIO pin number for your board
0 commit comments