File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,9 +91,11 @@ while True:
9191## Extend the functionality of the led_light class
9292
9393> [ !Important]
94- > Make sur eyou now edit the class in the ` project\lib\led_light.py ` not your main python implementation.
94+ > Make sure you edit the class in the ` project\lib\led_light.py ` , not your main.py implementation.
9595
9696``` python
97+ from time import sleep, time
98+
9799 def flash (self , duration = 5 ):
98100 # Method to flash the LED on and off every 0.5 seconds for a given duration
99101 if self .__flashing:
@@ -104,7 +106,7 @@ while True:
104106 self .toggle()
105107 sleep(0.5 ) # Delay for 0.5 seconds
106108
107- def on_for (self , duration ):
109+ def on_for (self , duration = 5 ):
108110 # Turns the LED on for a specified duration (in seconds) and then turns it off.
109111 self .on()
110112 if self .__debug:
You can’t perform that action at this time.
0 commit comments