@@ -64,7 +64,6 @@ Association in Object-Oriented Programming (OOP) describes the relationship betw
6464- It represents a "uses-a" or "knows-a" relationship.
6565- The lifetime of associated objects is independent—neither object controls the lifecycle of the other.
6666
67-
6867``` mermaid
6968classDiagram
7069 class Pin {
@@ -86,8 +85,9 @@ classDiagram
8685 }
8786
8887 class Audio_Notification {
89- - bool __debug
90- - float _last_toggle_time
88+ - __debug: bool
89+ - __last_toggle_time: floot
90+ - __pin: int
9191 + Audio_Notification(pin, debug=False)
9292 + warning_on()
9393 + warning_off()
@@ -96,10 +96,10 @@ classDiagram
9696 PWM <|-- Audio_Notification : Inheritance
9797
9898 class Led_Light {
99- - bool __debug
100- - int __pin
101- - bool __flashing
102- - float __last_toggle_time
99+ - __debug: bool
100+ - __pin: int
101+ - __flashing: int
102+ - __last_toggle_time: float
103103 + Led_Light(pin, flashing=False, debug=False)
104104 + on()
105105 + off()
@@ -111,10 +111,10 @@ classDiagram
111111 Pin <|-- Led_Light : Inheritance
112112
113113 class Pedestrian_Button {
114- - int __pin
115- - bool __debug
116- - int __last_pressed
117- - bool __pedestrian_waiting
114+ - __pin: int
115+ - __debug: bool
116+ - __last_pressed: int
117+ - __pedestrian_waiting: bool
118118 + Pedestrian_Button(pin, debug)
119119 + button_state : bool
120120 + button_state(value)
@@ -123,13 +123,13 @@ classDiagram
123123 Pin <|-- Pedestrian_Button : Inheritance
124124
125125 class Controller {
126- - Led_Light __Ped_Red
127- - Led_Light __Ped_Green
128- - Led_Light __Car_Red
129- - Led_Light __Car_Amber
130- - Led_Light __Car_Green
131- - Audio_Notification __Buzzer
132- - Pedestrian_Button __Button
126+ - __Ped_Red: Class Led_Light
127+ - __Ped_Green: Class Led_Light
128+ - __Car_Red: Class Led_Light
129+ - __Car_Amber: Class Led_Light
130+ - __Car_Green: Class Led_Light
131+ - __Buzzer: Class Audio_Notification
132+ - __Button: Class Pedestrian_Button
133133 - bool __debug
134134 - str state
135135 - float last_state_change
@@ -141,9 +141,10 @@ classDiagram
141141 + update()
142142 }
143143
144- Led_Light --> Controller: Association
144+ Led_Light --> Controller : Association
145+ Audio_Notification --> Controller : Association
145146 Pedestrian_Button --> Controller : Association
146- Audio_Notification --> Controller: Association
147+
147148```
148149
149150### Setup differnet states of the controller using association
0 commit comments