add interrupt read example
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user