Navigation

  • index
  • next |
  • previous |
  • 16-223 Creative Kinetic Systems »
  • Technical Exercises »
  • Exercise: Soft Blink

Exercise: Soft Blink¶

Objective¶

Use conventional programming structures such as loops, local variables, and functions to implement software PWM using the on-board LED.

Steps and observations¶

  1. Load and run the SoftBlink1 sketch.

  2. Read through the explanations in the comments. Try varying the parameters.

  3. Load and run the SoftBlink2 sketch.

  4. Read through the explanations in the comments. Try modifiying the pattern.

Comments¶

This exercise demonstrates how defining functions can improve clarity and maintainability of the code by reducing redundancy. Another framing is that function definitions constitute a new application-specific language. By creating a new abstraction of the low-level ramp pattern, it becomes to simpler to express the solution to the higher-order problem of generating the complex blink pattern over time.

Challenges¶

  1. Add a sensor acquisition process to read an external input and modulate the performance.

Arduino Code¶

  1. Documentation: SoftBlink1 Arduino Sketch

  2. Documentation: SoftBlink2 Arduino Sketch

  3. Sketch Folder: SoftBlink1

  4. Sketch Folder: SoftBlink2

Table of Contents

  • Exercise: Soft Blink
    • Objective
    • Steps and observations
    • Comments
    • Challenges
    • Arduino Code

Previous topic

Exercise: Coding, Compiling, Deploying

Next topic

Exercise: Bench, Battery, Grid

Quick search

Navigation

  • index
  • next |
  • previous |
  • 16-223 Creative Kinetic Systems »
  • Technical Exercises »
  • Exercise: Soft Blink
© Copyright 2022, Garth Zeglin. Licensed under CC-BY-4.0. Last updated on 2022-12-07. Created using Sphinx 5.1.1. University legal notice.