fbpx
Stopwatch
MagicBlocks Project

Stopwatch

Make a stopwatch with Magicbit

What is a stopwatch?

A stopwatch is a timepiece designed to measure the amount of time that elapses between its activation and deactivation.

Magicblocks is easy visual programming software to program your Magicbit. Anyone can program their microcontroller by using magicblocks.io and there is no need for programming knowledge. You can sign up for free.

Youn will need the following blocks.

 

Connect them as follows.

Double click on the first Digital in node.

 

Select the right push button to pause the timer. Select the method as Interrupt.

 

Double click on the second Digital in node.

 

Select the left push button to start the timer. Select the method as Interrupt.

 

Double click on the Analog in node. Select pin as POT and method as Interrupt.

 

Be sure that you have selected the correct Device Id in all of the above.

Change Node?

Change node will allow you to change a message payload or add new properties.

 

Double click on the following two change nodes and change as follows.

 

 

Double click on the following two change nodes and change as follows.

 

Double click on the Switch node and change as follows.

Double click on the trigger node and change as follows.

Double click on the Counter node and change as follows.

 

Note:

Make sure to connect the output of the counter node as follows.

Double click on the Display node and change as follows.

Deploy the program.

From the left button, you can start the timer.

From the right button, you can pause the timer.

By rotating the POT, you can reset the timer.

Related Posts
Leave a Reply