Keyestudio KS4028 Manual page 247

Smart home kit for micro:bit
Table of Contents

Advertisement

www.keyestudio.com
not completely continuous. Actually, it generates 25 pictures per second,
which cannot be told by human eyes. Therefore, we mistake it as a
continuous process. PWM works in the same way. To output different
voltages, we need to control the ratio of 0 and 1. The more'0'or '1'
output per unit time, the more accurate the control.
In the graphic below, the green lines represent a regular time period. This
duration or period is the inverse of the PWM frequency. In other words,
with Micro:bit's PWM frequency at about 500Hz, the green lines would
measure 2 milliseconds each. A call to analogWrite() is on a scale of 0-255,
such that analogWrite(255) requests a 100% duty cycle (always on), and
analogWrite(127) is a 50% duty cycle (on half the time).
247

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents