Get the latest tech news
Inside the box: Everything I did with an Arduino starter kit
Diving into Elegoo Arduino Uno R3 Starter Kit, the most complete Arduino kit
PWM is a technique used to control the average power delivered to an electrical device by varying the width of pulses in a digital signal, which when done fast enough in a visual output such as a LED, is perceived to the human eye as being of a smooth continuous amplitude, instead of a stream of single bursts. I wondered why an external module was required to calculate distances, so I’ve implemented an algorithm from scratch that took into account the speed of sound and the time taken by an ultrasonic pulse to be received back by the sensor. The objective of this experiment was to make the blue LED blink whenever the gyro was disturbed, but this resulted in a mostly unpredictable output, where the root cause is likely to lie on the incorrect combination of commands needed to set up the module.
Or read this on Hacker News