| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Simple Timer Example

The Simple Timer Example demonstrates the usage of the Simple timer. It demonstrates the two modes of the module (single shot mode and repeated mode) to blink two LEDs.

When the application starts, the GPIO pins are configured as outputs to drive the LEDs. The application then uses the simple timer driver library and alternates between the two timer modes. During startup, both LEDs are lit for one second. Then the application enters single shot mode for 2 seconds before repeated timer mode is started. After 2 seconds, both LEDs are lit again and the application loops.

See the following illustration for details.

Simple timer example state machine

You can find the source code and the project file of the example in the following folder: `<InstallFolder>\examples\peripheral\simple_timer`

# Testing

Test the Simple Timer Example application by performing the following steps:

1. Compile and program the application.
2. Observe that the LED state is changed as expected:
   1. Both LEDs are lit for one second.
   2. LED 1 blinks for 2 seconds.
   3. LED 2 blinks for 2 seconds.
   4. The application loops.