RobotGeek 101: Pulse Width Modulation (PWM) Reference

This lesson is part of the RobotGeek 101 Learning Series. If you haven't already, please download the example sketches, and follow through the Geekduino Getting Started Guide to handle the foundations of using the Arduino IDE in conjunction with the Geekduino.

Welcome to RobotGeek 101 : Pulse Width Modulation (PWM) Reference. This reference expands upon the concepts covered in the Pulse Width Modulation (PWM) Introduction, and introduces more advanced concepts that will give you a more comprehensive knowledge of the workings of Pulse Width Modulation.

Parts used in this lesson:

Everything you need to complete chapters 1-7 in RobotGeek 101 are available in the RobotGeek Basic Experimenter's Kit.

Contents:

Introduction

E-fadeUpDown

code.png Click here to expand the code

diagram.png Click here to expand the diagram

Let's use the Arduino IDE to fade an LED using Pulse-width modulation. Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > RG101 > 04 - PWM > E-fadeUpDown

Back to Contents

F-fadeWithoutDelay

code.png Click here to expand the code

diagram.png Click here to expand the diagram

Let's use the Arduino IDE to fade an LED up and down using Pulse-width modulation and millis() to avoid delays. Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > RG101 > 04 - PWM > F-fadeWithoutDelay

Back to Contents

G-motorController

code.png Click here to expand the code

diagram.png Click here to expand the diagram

Let's use the Arduino IDE to control a single motor attached to a 1A Dual TB6612FNG Motor Driver or similar motor driver. Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > RG101 > 04 - PWM > G-motorController

Back to Contents

PWM Examples from Arduino

Feedback Form


Search