Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedYousryM committed Feb 4, 2024
1 parent 3a323a4 commit 373144c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,24 @@ It is also possible to make a sequence of steps. Where each step is considered a
void NonBlockingSequence.AddDelayInMillis(unsigned long val)
```
Add a new delay step to the sequence. This delay waits `val` milliseconds. This delay does not block other codes outside the sequence. It only delays the execution of the next step in the same sequence.
This method uses Arduino Timer0. So, to insure this method functions properly, do not change the timer0 regesters.

### Do Sequence Steps
```c++
void NonBlockingSequence.DoSequence()
```
Run the sequence step by step. The steps can either be a boolean function or timer. Each time the function `DoSequence()` is called, a step is called until a trigger action is happened. The trigger action can be:
Run the sequence current step. The steps can either be a boolean function or timer. Each time the function `DoSequence()` is called, a step is called until a trigger action is happened. The trigger action can be:
- for boolean function: return true.
- for timer : running time is over.

After the trigger action is occurred. The sequence start to call the next step.
The function `DoSequence()` should be called inside the `void loop()` method.
The function `DoSequence()` should be called inside the `void loop()` method. Because each time `DoSequence()` is called the current steps is executed. As the method `DoSequence()` is called many times, the sequence go forward step by step.

### Sequence end
```c++
bool NonBlockingSequence.Finish();
bool NonBlockingSequence.isFinish();
```
Check if the sequence reach its end, and finish executing all sequence steps.
Check if the sequence reach its end, and finish executing all sequence steps. If the sequence is repeated infinite number of times without end, using `Repeat()` function, then `isFinish` function always return false.

### Restart
```c++
Expand Down

0 comments on commit 373144c

Please sign in to comment.