21 October 2016

Day Two - Stopwatch Part One

Get in! I made my first micro:bit program. Here is how I made a basic stopwatch.


Step One                                         

Go on to the block editor on microbit.org. At first there will be a blank screen.

Step Two

Drag the 'set item to' block in the variable row on to the screen and rename the variable 'stopwatch'. Grab the block in the maths row that says zero. Snap it on to the previous block.Then cover this with the 'on A pressed' loop.

Step Three

Next, put a 'show number' block down with the variable name 'stopwatch' block in the number section under that, place a 'change item by one' block down. Change the item button to 'stopwatch' and put a forever loop over it.

Step Four

Now we're getting on to the tricky bit!(well for me it was) Duplicate step two but replace A with B, and crate a new variable called pause and replace it with 'stopwatch'

Step Five

Under the section you made in step two, at the bottom of the code use the variable row to add in set pause to false'. Your code should look like this: 

    

Step Six

Add this into the forever loop:
If pause = True
                      do  pause(ms) 5000                     

Step seven

This is the last step! Add in loose(don't connect it to anything else) 'set pause to ...false' Then, press compile and plug in your micro:bit. Drag the hex file to the micro bit file and... you're done!

My Verdict.

At first found it a bit difficult but hopefully it was easier for you as I tried to explain the instructions as clear as I could. Also for more micro:bit ideas go to: http://www.101computing.net/category/bbc-microbit/


For the video:



No comments:

Post a Comment