top of page
  • Black Facebook Icon
  • Black Instagram Icon
  • Black Pinterest Icon

How to Create Stopwatch on micro:bit

Writer's picture: Apurva BhaleraoApurva Bhalerao

Updated: Mar 4, 2022

Following are steps for creating Stopwatch

  1. Click this link https://microbit.org/

  2. Then click on official code editor Microsoft Make Code to do programming

  3. Then click on New Project and give project name as Stopwatch then this window will display


4. First remove on start block and forever block from editor workplace then from input drag and drop on button A pressed on editor workplace


5. Create a variable start and put set start block on button A pressed to running time (ms)

 
 

6. Create a variable elapsed and put it in the set elapsed block on button B pressed to running time (ms) to start. (That means ad code to compute the difference between the running time and value time. this is the elapsed millisecond since pressing button A)



7. Add code to show the number of milliseconds elapsed. use integer division to divide elapsed by 1000 and get seconds



8. if you have a micro:bit connected into a laptop/ pc/ mobile using USB then , Click on download button and transfer your code ( hex file) to the micro:bit and see the result.


9. Result : Press A to start the stopwatch and press B to get the current elapsed time. you can press B multiple time


Result:

//video


 
 
 

Enroll to Free Courses

Get In Touch

Address: Decent Enclave, 2nd Floor, Darga Rd, opp. More Mart, Ulkanagari, Aurangabad, Maharashtra 431001

Contact : +91-9404865609

Email

support (at) kitflix.com

  • Instagram
  • Facebook
  • Twitter
  • LinkedIn
  • YouTube

© 2022 by Kitflix Technologies Private Limited.

bottom of page