THE MICRO:BIT WEBSITE AND CODING ENVIRONMENT

      The Micro:bit website, www.microbit.org, is an excellent resource for all things Micro:bit.  There are many examples of lessons, activities, projects, and tutorials.  There is no fee and you don't even need to create an account.  Some of these materials will be broken out and discussed in detail in the Resources page of this site, but the micro:bit site is very accessible and easy to use and well worth exploring on your own.

     In addition to the resources you'll also find programming environments for several different  languages including MakeCode, Python, JavaScripts, and Scratch.  There are separate pages on this website for MakeCode, Java, and Python on this website, but I would like to provide a quick introduction to some of the features of the Micro:bit website coding environment.

     Start by going to the microbit.org site linked above.  Once there select the Let's code tab from the menu line.  This takes you to a page that provides information about and links to the different programming environments.  Select the MakeCode editor from the Quick Links.  Once there you'll be prompted to start a New Project - select that option.  (You'll also see links to tutorials and sample projects of all kinds, but for now let's take a look at the basic interface.)  

MakeCode/JavaScripts environment


     A couple of things to notice here: On the top bar, the option Blocks is highlighted.  That means I'm in the MakeCode Blocks programming environment.  Just to the right of Blocks is JavaScript.  Clicking on this will take me to the JavaScripts environment.  What's really nice about this environment is that whatever I've programmed in one language will be translated to the other language when I switch options.  That can be very helpful if you're just learning Java, you can program in the easier to learn  Blocks language, then see how the same thing is done in Java.
     Down the center of the page are the program command tabs.  If you click on the tab, Input for example, you'll see a list of the available commands for that tab.  You can then drag the command over to the editing screen (the empty area to the right.)  Once there you can connect the blocks to build a program.  On the screen shown above, there are two commands from the Basic tab, On Start and Forever.
     At the bottom of the list of tabs, you'll see Advanced.  Clicking that will show you more command tabs and a tab for Extensions.  Extensions are the special commands related to particular Breakout Boards and Kits.  When you program the SparkFun Micro:bot, you will need to click this Tab and select the set of commands for that kit.
     To the left of the screen you'll see an image of the front of the Micro:bit.  This is a virtual Micro:bit and is interactive.  That means you can run your program on the virtual bit.  So, if you created a program that has the word "Hello" scroll across the led matrix when the A button is pressed, pressing the A button on the virtual bit, using your touchpad or mouse, will cause the word "Hello" to scroll across the virtual led screen on the bit.  It is a bit limited since it works with the most simple input-output devices on the board, but it can be very helpful in debugging programs.
     At the bottom left of the screen you'll see the Download button.  It will send your program to the Downloads Folder on your computer.  From there, you can drag it to your Micro:bit, which shows up as a USB type removable device on your computer.  

Python environment


          This is the editor you would see if you'd selected the Python Editor from the Lets Code page.  As you can see the Python environment is very different from the MakeCode environment.  It is text-based as opposed to block-based.  The menu tab is pretty basic with tabs for connecting and file management.  And there is no virtual Micro:bit to provide quick, visual feedback.  However, as with the MakeCode editor, there are lots of tutorials and example programs.



   



Comments

Popular posts from this blog

INTERACTIVE ROBOT DESIGN: AN INTRODUCTORY COURSE