TactivergeLite

Lite / Building Machines That Respond / Week 7

Week 7: Functions

Term 1: Computational Thinking

This week you will

Lessons

  1. Package a calculation as a function · about 35 min
    A robot converts wheel rpm to speed in six places in its code. One of them has a bug. How do you fix all six at once?
  2. Promises and proof: tests with assert · about 35 min
    Three versions of a °C-to-°F function all run without errors. Only one is right. How can three lines of tests tell them apart instantly?
  3. Decompose a program into functions · about 40 min
    Raw ADC counts in, a temperature report out. Should that be one long block of code, or three small functions?
← Week 6Week 8 →