Skip to content

Commit 581842a

Browse files
add
1 parent 509a1e0 commit 581842a

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

tutorials/Lecture1.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ classDiagram
8181

8282
Explanation:
8383

84-
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).
84+
1. Class Name (Top Section): This is the uppermost part of the box. It displays the name of the class (e.g., Student, Order, traffic).
8585
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.
8686
3. Methods (Bottom Section): This section lists the methods (or operations/functions) that belong to the class.
8787
Each method is shown with its visibility, name, parameters, and return type.
@@ -176,14 +176,14 @@ A class is like a blueprint for an object—it defines the attributes and method
176176
from machine import Pin
177177
from time import sleep
178178

179-
led_car_red = Pin(3, Pin.OUT)
180-
led_car_orange = Pin(5, Pin.OUT)
181-
led_car_green = Pin(6, Pin.OUT)
179+
led_traffic_red = Pin(3, Pin.OUT)
180+
led_traffic_amber = Pin(5, Pin.OUT)
181+
led_traffic_green = Pin(6, Pin.OUT)
182182

183183
while(True):
184-
led_car_red.toggle()
185-
led_car_orange.toggle()
186-
led_car_green.toggle()
184+
led_traffic_red.toggle()
185+
led_traffic_amber.toggle()
186+
led_traffic_green.toggle()
187187
sleep(1)
188188
```
189189

tutorials/Lecture2.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ This Python implementation below demonstrates the concept of encapsulation. Unli
136136
- Flexibility: Implementation can change without affecting code that uses the object, as long as the public interface remains the same.
137137

138138
```python
139+
"""
140+
RUN AS PYTHON NOT MICROPYTHON
141+
"""
139142
class Led_Light():
140143
def __init__(self, pin, flashing=False, debug=False):
141144
self.debug = debug #PUBLIC attribute

tutorials/Lecture3.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ while True:
4848

4949
## Implement a Non-Blocking Flash Method
5050

51+
The 'Non Blocking' approach is preferred for timing regular events in microcontroller programming because it avoids blocking the code with sleep statements, allowing the controller to multitask.
52+
5153
> [!Important]
5254
> Make sure you edit the in the `project\lib\led_light.py`, not your main.py implementation.
5355

0 commit comments

Comments
 (0)