First Things First:
The code you create will need to be downloaded directly to your micro:bit board so before we begin, please make sure the browser you are using is set up to ASK where you want the file saved. Many of the browsers (Safari, Chrome, Edge etc, ) are often set to automatically save the file to the "Downloads" folder on the computer you are using.
IF you are not sure how to change this, or verify it, let one of the camp instructors know so they can help.
In Chrome, you click on the vertical 3 dots in the top, right corner of the screen and select "Settings". Then, click on the "Downloads" menu on the left, then, finally, turn the toggle switch to the "on" position. Now, when you click on "download" the browser should ask you where you want your file with the code you've written saved, and you can select the micro:bit.
Writing Your Code:
What do other coders do?
Most coders these days do not just sit down and write code. They often will use existing code - sometimes changing some code they wrote for some other project, and sometimes using code written by another coder, and then adapting it to make it do what they need it to do for this situation.
What are "Code Editors" or IDEs?
There are several different programming apps also known as an Integrated Development Environment (IDE) that can be used to create and edit code for the micro:bit, and it can be coded in a couple of different coding languages.
What are "Extensions"?
Most IDEs/code editors can understand an extensive amount of code commands, but often coders need to add extensions that are additional code commands not included in order to communicate with additional components and features. (think about it, if IDEs came with every possible command...) so for example, when using the servo, the code editor will need the code commands specific to the servo added.
What coding language works best for you?
For many of the tutorials/experiments, I have included code that can be used with two different code editors we will be using in this camp. The first two coding languages use the Microsoft MakeCode online IDE editor. These are MakeCode Python and MakeCode Block (similar to Scratch or Blockly).
The third coding language is called MicroPython which is Python specifically for microcontrollers such as Arduinos and micro:bits. BBC Microbit created their own version of MicroPython, along with the BBC micro:bit Python online IDE editor to code with.
For either MakeCode Python or micro:bit Python code examples, you can copy and paste, or type your code directly into the editors using the examples I provided with each tutorial/experiment. Once you are familiar with more of the code commands and syntax, you might try to write some yourself!
What about using a simulator?
TinkerCad micro:bit simulator displays the code in MakeCode Python and can be used to test first, then re-create in block, or copy and paste Python into the MakeCode IDE editor!
All of the above code editors include an on-screen micro:bit simulator that allows you to use them with or without an actual micro:bit board attached.
We will learn more about those IDEs soon.
On your own, you can learn more about theses three code-editing/writing apps, by going directly to their webpages, or clicking on the links here on this site:
The following sub-pages can be used anytime to review how these apps work.
Click HERE to go to the next page