All tutorials

Time’s Up! Build a PicoBricks Timer

picobricksBeginner ⏱ 45 mins

Overview

In this project we are going to create our own countdown timer using PicoBricks.

Measuring time in electronic projects is really important. Think about a washing machine. It needs to know how long to spin the drum in each direction and how long the water needs to flow to dissolve the detergent.

Our timer will work a bit like that. When PicoBricks starts, it shows a welcome message and instructions for using the timer. As you turn the , it sets a value. Each press of the locks that value in and moves you on to the next one: first the hours, then the minutes, then the seconds.

Once the time is set, the countdown begins and the remaining time is shown on the . When the timer reaches zero, the sounds and the LEDs light up until you press the button to stop them.

🎯

What you'll learn

  • How to control and count down time within a project
  • How to read a potentiometer to set a value
  • How to use functions to keep your code tidy and reusable
  • How to show numbers and messages on an OLED screen
  • How to use a buzzer and LEDs to make an alarm