Skip to content

Commit a712190

Browse files
Update Lecture4.md
1 parent a7f1957 commit a712190

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

tutorials/Lecture4.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
- [Class Overview](#class-overview)
66
- [Create Files](#create-files)
77
- [Imports and Constructor](#imports-and-constructor)
8-
- [Implement an Interupt](#implement-an-interupt)
8+
- [Implement an Interrupt](#implement-an-interrupt)
99
- [Getter and Setter](#getter-and-setter)
10-
- [Create a Callback Method for the Interupt Trigger](#create-a-callback-method-for-the-interupt-trigger)
10+
- [Create a Callback Method for the Interrupt Trigger](#create-a-callback-method-for-the-interrupt-trigger)
1111

1212
## Class Overview
1313

14-
The Pedestrian_Button class extends the machine.Pin class to provide a debounced button interface specifically designed for pedestrian crossing systems. It uses interrupt-based detection and software debouncing to reliably capture button presses. It also provides optional debug output.
14+
The Pedestrian_Button class extends the Pin class to provide a debounced button interface specifically designed for pedestrian crossing systems. It uses interrupt-based detection and software debouncing to reliably capture button presses. It also provides optional debug output.
1515

1616
## Create Files
1717

@@ -20,7 +20,7 @@ The Pedestrian_Button class extends the machine.Pin class to provide a debounced
2020

2121
## Imports and Constructor
2222

23-
In your `pedestrian_button.py` include your imports, define the class and configure the initialiser with the paramters pin and debug. Add the required parameters to store time and hold state when the button has been pressed.
23+
In your `pedestrian_button.py` include your imports, define the class and configure the initialiser with the parameters pin and debug. Add the required parameters to store time and hold state if the button has been pressed.
2424

2525
```python
2626
from machine import Pin
@@ -41,7 +41,7 @@ class Pedestrian_Button(Pin):
4141
) # Set up interrupt on rising edge
4242
```
4343

44-
## Implement an Interupt
44+
## Implement an Interrupt
4545

4646
An interrupt is a signal to the processor that an event needs immediate attention. Instead of constantly checking (polling) if something has happened, interrupts allow the system to be notified immediately when an event occurs.
4747

@@ -62,7 +62,7 @@ class Pedestrian_Button(Pin):
6262

6363
## Getter and Setter
6464

65-
Our system has a design requirement that the button state is stored until the walk lights have been displayed. So because we are not setting or getting the current state of the button as we did with the LED_Light Class, we will use an Adhoc method that updates the `__pedestrian_waiting` attribute.
65+
Our system has a design requirement that the button state is stored until the walk lights have been displayed. So, because we are not setting or getting the current state of the button as we did with the LED_Light Class, we will use an ad hoc method that updates the `__pedestrian_waiting` attribute.
6666

6767
- If `button_state()` is called with no arguments, it returns the current state (getter).
6868
- If `button_state(bool)` is called with a boolean argument, it sets the state (setter).
@@ -86,9 +86,9 @@ Our system has a design requirement that the button state is stored until the wa
8686
)
8787
```
8888

89-
## Create a Callback Method for the Interupt Trigger
89+
## Create a Callback Method for the Interrupt Trigger
9090

91-
This `clallback()` was configured in the attributes and will be executed in response to an interupt call.
91+
This `callback()` was configured in the attributes and will be executed in response to an interrupt call.
9292

9393
```python
9494
def callback(self, pin):
@@ -100,4 +100,4 @@ This `clallback()` was configured in the attributes and will be executed in resp
100100
self.__pedestrian_waiting = True
101101
if self.__debug:
102102
print(f"Button pressed on Pin {self.__pin} at {current_time}ms")
103-
```
103+
```

0 commit comments

Comments
 (0)