add interrupt read example

This commit is contained in:
2025-02-02 12:14:10 +05:30
parent 3a20606645
commit 33fdab9c18
2 changed files with 44 additions and 3 deletions

View File

@@ -283,8 +283,9 @@ onDelay = (onDelay+1) % totalDelay;
}
```
`onDelay` is maintained such that total time for each iteration remains constant, equal to `totalDelay`. This above code will make the LED look like the brightness changes.
The value of `onDelay` is maintained such that total time including the led off delay for each iteration remains constant, equal to `totalDelay`. This above code will make the LED look like the brightness changes.
This technique of changing the on time and off time for a given time period is called Pulse Width Modulation (PWM). The frequency of this signal is calculated as `1/totalDelay`, which is `1/(0.01 seconds)` => 100Hz. PWM can be achieved more efficiently using the dedicated PWM signal blocks available on the pico, which will be discussed in the later sections.
---
## Summary