TVZ Mechatronics Team


Zagreb University of Applied Sciences, Professional Study in Mechatronics

You are viewing an older revision! See the latest version

Timers interrupts and tasks

In the following exercises you will learn to use Timer, Timeout, Ticker and InterruptIn classes from the standard mbed library. The program codes are from the following excellent book: Toulson, R. & Wilmshurst, T. (2012). Fast and Effective Embedded Systems Design - Applying the ARM mbed, Newnes, Oxford, ISBN: 9780080977683.

Exercise 1: Using the mbed Timer

Examine the following code and try to figure out what will happen with the LEDs. Then test the program on an actual mbed and see if your predictions were correct.

#include "mbed.h"

Exercise 2: Using the mbed Timeout

Exercise 3: Using the mbed Ticker

Exercise 4: Using the mbed InterruptIn

Exercise 5: Switch debouncing

Exercise 6: Measuring distance with ultrasonic sensor HC-SR04


All wikipages