Navigation

  • index
  • modules |
  • next |
  • previous |
  • 16-223 Introduction to Physical Computing »
  • 2. Assignments »
  • 2.1. Technical Exercise Sequence »

2.1.3. Exercise: Soft Blink¶

2.1.3.1. Objective¶

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

2.1.3.2. 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.

2.1.3.3. 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.

2.1.3.4. Challenges¶

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

2.1.3.5. Arduino Code¶

  1. Documentation: SoftBlink1 Arduino Sketch
  2. Documentation: SoftBlink2 Arduino Sketch
  3. Sketch Folder: SoftBlink1
  4. Sketch Folder: SoftBlink2

Table Of Contents

  • 2.1.3. Exercise: Soft Blink
    • 2.1.3.1. Objective
    • 2.1.3.2. Steps and observations
    • 2.1.3.3. Comments
    • 2.1.3.4. Challenges
    • 2.1.3.5. Arduino Code

Previous topic

2.1.2. Exercise: Coding, Compiling, Deploying

Next topic

2.1.4. Exercise: Bench, Battery, Grid

Quick search

Enter search terms or a module, class or function name.

Navigation

  • index
  • modules |
  • next |
  • previous |
  • 16-223 Introduction to Physical Computing »
  • 2. Assignments »
  • 2.1. Technical Exercise Sequence »
© Copyright 2016, Garth Zeglin. Last updated on 2017-06-21. Created using Sphinx 1.2.3.