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/Lecture5.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,27 @@
9
9
## Multiple Inheritance
10
10
Multiple Inheritance is used to inherit the properties of multiple classes. However, Python does not allow multiple inheritance from classes that have incompatible memory layouts at the C level, which is common with hardware classes in MicroPython.
11
11
12
+
```mermaid
13
+
classDiagram
14
+
class A {
15
+
+methodA()
16
+
}
17
+
class B {
18
+
+methodB()
19
+
}
20
+
class C {
21
+
+methodC()
22
+
}
23
+
class D {
24
+
+methodD()
25
+
}
26
+
27
+
A <|-- C : Inheritance
28
+
B <|-- C : Inheritance
29
+
B <|-- D : Inheritance
30
+
C <|-- D : Inheritance
31
+
```
32
+
12
33
This code snippet is just to demonstrate the concept and syntax of multiple inheritance.
13
34
14
35
```python
@@ -121,6 +142,10 @@ classDiagram
121
142
122
143
### Setup differnet states of the controller using association
123
144
145
+
In the context of a microcontroller, state refers to the current values or conditions of the system’s internal variables, inputs, outputs, and memory at a specific moment in time. State is crucial for determining how the microcontroller should behave next.
146
+
147
+
For example, in a simple traffic light controller, one of the states could be `Traffic_Go` in which the green lights are `on()` while both the red and amber lights are `off()`.
Copy file name to clipboardExpand all lines: tutorials/Lecture6.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,15 @@
4
4
5
5
- Open & Closed Loop Control Systems
6
6
- Open Loop State Machine
7
+
- Implement an Open Loop State Machine
7
8
8
9
## Open & Closed Loop Control Systems
9
10
10
11
Open and closed loop control systems are two fundamental types of control systems used in engineering, automation, robotics, and other fields to manage the behavior of devices or processes.
11
12
12
-
### OpenLoop
13
+
### Open-Loop
13
14
14
-
An openloop control system is a type of system in which the control action is independent of the desired output or the actual system output.
15
+
An open-loop control system is a type of system in which the control action is independent of the desired output or the actual system output.
15
16
16
17
How it works:
17
18
@@ -24,9 +25,9 @@ Example:
24
25
25
26
A microwave oven: You set the cooking time, and the microwave runs for that duration regardless of how hot the food actually gets.
26
27
27
-
### ClosedLoop
28
+
### Closed-Loop
28
29
29
-
A closedloop control system (also called a feedback control system) is a system in which the control action is dependent on the desired output and the actual system output.
30
+
A closed-loop control system (also called a feedback control system) is a system in which the control action is dependent on the desired output and the actual system output.
30
31
31
32
How it works:
32
33
@@ -39,7 +40,7 @@ How it works:
39
40
40
41
Example:
41
42
42
-
A home thermostat: The home owner sets a desired temperature. The system measures the actual room temperature and adjusts the heater/cooler to reach and maintain the desired temperature. As the system gets closer (or overshoots) to the desired temperature it adjusts the output.
43
+
A home thermostat works by allowing the homeowner to set a desired temperature. The system then measures the actual room temperature and adjusts the heater or cooler to reach and maintain the set temperature. As the system approaches—or overshoots—the desired temperature, it modifies its output accordingly.
43
44
44
45
## State Machine
45
46
@@ -50,9 +51,9 @@ Key concepts:
50
51
- States: Distinct modes or conditions in which the system can exist.
51
52
- Transitions: Rules that define how and when the system moves from one state to another, often triggered by events or inputs.
52
53
- Events/Inputs: External actions or signals that cause state transitions.
53
-
- A State Machince can be open or closed
54
+
- A State Machine can be open or closed
54
55
55
-
## Implement a Open Loop State Machine
56
+
## Implement an Open Loop State Machine
56
57
57
58
## Usage: Controller Class (State Machine Example)
0 commit comments