From 3aed472ed39b831872feb0634d879ba2710b2d6b Mon Sep 17 00:00:00 2001 From: Tom Ball Date: Thu, 3 Apr 2025 09:44:13 -0700 Subject: [PATCH 1/4] more changes --- _includes/editor.html | 23 +--- docs/develop.md | 225 +---------------------------------- docs/faq.md | 31 +---- docs/jacdac.md | 38 +----- docs/language.md | 247 +-------------------------------------- docs/localization.md | 14 +-- docs/manual.md | 155 +----------------------- docs/purchase.md | 87 +------------- docs/robot.md | 79 +------------ docs/robots-supported.md | 139 +--------------------- docs/samples.md | 83 +------------ 11 files changed, 16 insertions(+), 1105 deletions(-) diff --git a/_includes/editor.html b/_includes/editor.html index 5647203a..ef3551b2 100644 --- a/_includes/editor.html +++ b/_includes/editor.html @@ -228,23 +228,12 @@ -
-
-
- MicroCode Logo -
-
- -
+

+ MicroCode has moved: + + https://microbit-apps.github.io/microcode-classic/docs/manual + +

{% include footer.html %} {% include dialogs.html %} diff --git a/docs/develop.md b/docs/develop.md index ec32882b..5a91d99e 100644 --- a/docs/develop.md +++ b/docs/develop.md @@ -3,227 +3,4 @@ title: Developer Docs image: ./docs/images/generated/sample_smiley_buttons.png --- -MicroCode is open source at https://github.com/microsoft/microcode and welcomes contributions. -The easiest way to get started is to open this repository in a GitHub Codespace and everything will be ready for you. - -We recommend using [Visual Studio Code](https://code.visualstudio.com/) as it provides excellent support -for MakeCode editing, Git, and Codespaces. - -## Codespaces setup - -- open [https://github.com/microsoft/microcode](https://github.com/microsoft/microcode) -- click on `Code` drop down and select `Create Codespace on main` -- you can do your editing from VS Code online or click on `Codespaces` in lower left and select `Open in VS Code` to use the desktop version (must be installed on your machine) -- press "Ctrl + `" to open a terminal and you're ready to go! - -In the future, click again on `Code` to find previously created Codespaces. - -## Local Install (skip in Codespaces) - -- install [Node.js](https://nodejs.org/en/) -- install the MakeCode command line tools (`mkc` for short) - -```bash -npm install -g -u makecode -``` - -- clone this repo - -```bash -git clone https://github.com/microsoft/microcode -``` - -- setup MakeCode project structure (one time only) - -```bash -cd microcode -mkc init -``` - -## Build - -Note that you can open terminals directly from VS Code by pressing "Ctrl + `". - -- start a compilation server that will automatically compile and reload - a compile web version of the editor - -```bash -sh serve.sh -``` - -- open to web editor at http://127.0.0.1:7001/ - -To flash a micro:bit, - -- build a micro:bit Hex file and deploy - -```bash -mkc build --hw n3 -d -``` - -If you are running in Codespaces, the `-d` option won't work. Instead, right click on `built/binary.hex` in the explorer and select `Download...` to download the hex file to your micro:bit. - -## With Jacdac devtools - -To load the local editor in a Jacdac devtools page, click on the **sim** link at the bottom -of the local server on http://127.0.0.1:7001/. Or, - -https://microsoft.github.io/jacdac-docs/clients/javascript/devtools?jacscript=1&simulators=microbitmicrocode#http://127.0.0.1:7001/index.html?usb=0 - -## Creating artwork - -To preview all artwork, click on the `art` icon at the bottom right of the local editor (and wait...). Use `save` to download all artwork on the `images/generated` folder. - -If you want to create/edit new sprites, you should import this web site into https://arcade.makecode.com, using the following directions: - -- create 16 x 16 sprite in assets.ts (contains all the artwork for MicroCode) -- copy the code from the JavaScript view of https://arcade.makecode.com -- paste code into assets.ts into VS Code -- make sure it works locally -- git commit and push - -You might also be able to commit and push directly from the web site, but we find that this isn't very reliable. - -Some art images are precomputed, you will need to load scripts/renderart.ts in MakeCode Arcade and copy the console output back into the project. - -## Updating sample - -- Browse to http://127.0.0.1:7001/index.html?compress=0 -- Once your sample is ready, copy the string after `#` and copy it into `samples.ts` - -## Updating GitHub pages - -To bump and refresh the github pages javascript and pre-built .hex file, run this script - -```bash -sh ./bump.sh -``` - -A GitHub Action will trigger and update the web site within a few minutes. - -## Running Jekyll locally - -It is easiest to launch a codespace to get the right setup to run Jekyll (Ruby). Run the Jekyll setup script - -```bash -sh scripts/setup-jekyll.sh -``` - -then launch jekyll - -```bash -bundle exec jekyll serve --incremental -``` - -and nav to http://localhost:4000 - -## Re-building library - -There is library of LED animations etc in `scripts/lib/lib.js`. To rebuild, make sure you have `jacscript` checked out -parallel to `microcode` and run: - -```bash -cd scripts -./genlib.sh -``` - -## Localization - -- [ ] `locales/tooltips.json` contains the tooltips displayed on the micro:bit screen -- [ ] `_includes/dialogs.html` contains the webusb dialogs - -### Adding tooltips in source code - -- add new tooltip to `locales/tooltips.json` -- refresh tooltips.ts - -```bash -node scripts/lochex.mjs en -``` - -### Updating crowdin - -- Go to https://crowdin.com/project/makecode/content/files -- click on `Update` for `microcode/tooltips.json` and load `locales/tooltips.json`. - -### Refreshing translations - -- go to https://crowdin.com/project/makecode/tools/content-delivery -- click `Release` on the microcode distribution -- bump repo - -## Dependencies - -This app is built with [MakeCode Arcade](https://arcade.makecode.com/), specifically targeting the NRF52833 MCU of the micro:bit V2 (for now). There are a number of repos containing the C++ of the underlying CODAL runtime: - -- https://github.com/microsoft/codal-jacdac: an add-on to CODAL that provides Jacdac runtime, virtual machine, and services representing micro:bit features -- https://github.com/microsoft/pxt-arcade: the MakeCode Arcade editor, with support for NFR52833, the MCU of the micro:bit V2, which depends on - - https://github.com/mmoskal/codal-nrf52833-dk: micro:bit device drivers - - https://github.com/lancaster-university/codal-nrf52: CODAL runtime for NRF52 class MCUs - - https://github.com/lancaster-university/codal-core: CODAL runtime - -## Build setup for C++ runtime dev - -- clone https://github.com/microsoft/pxt-arcade repo at the same level as `microcode` -- run: - -```bash -npm install -g pxt-core -cd pxt-arcade -yarn install -mkdir projects -cd projects -mkdir microcode -cd microcode -export PXT_ASMDEBUG=1 -export PXT_COMPILE_SWITCHES=size -export PXT_FORCE_LOCAL=yes -export PXT_NODOCKER=yes -export PXT_RUNTIME_DEV=yes -``` - -- you may use `npm` instead of `yarn` -- you may skip `PXT_NODOCKER` if you don't have locally installed `arm-none-eabi-gcc` -- in `projects/microcode` create `pxt.json` file with the following contents: - -```json -{ - "additionalFilePath": "../../../microcode", - "dependencies": { - "game---light": "file:../../libs/game---light", - "hw---n3": "file:../../libs/hw---n3", - "device": "file:../../libs/device", - "codal-jacdac-pxt": "file:../../../microcode/codal-jacdac-pxt" - } -} -``` - -- run `pxt` - it will compile an deploy -- run `code built/codal/libraries/codal-*` -- checkout `main` or `master` in all `codal-*` repos and in `jacdac-c` - -Make sure not to delete `projects/microcode/built` since it contains your sources. -If possible, you can move `built/codal/libraries` folder somewhere else, and symlink it inside `built/codal` -to avoid accidentally deleting it. - -## Contributing - -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us -the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. - -When you submit a pull request, a CLA bot will automatically determine whether you need to provide -a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions -provided by the bot. You will only need to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -## Trademarks - -This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft -trademarks or logos is subject to and must follow -[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). -Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. -Any use of third-party trademarks or logos are subject to those third-party's policies. +MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/develop](here) \ No newline at end of file diff --git a/docs/faq.md b/docs/faq.md index 7d8b5a21..6e59d05d 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -3,33 +3,4 @@ title: Frequently Asked Questions image: ./docs/images/generated/sample_smiley_buttons.png --- -![emoji hello](./images/generated/icon_M19hello.png){:class="icon-sample"} - -## How do I share my program? - -From the web editor, copy the URL... it contains your whole program. - -## How do I print my program? - -Click the `screenshot` button at the bottom to get a rendered image of your program that you can share and print. - -## How do I translate MicroCode? - -Checkout the [localization](./localization) to see how you can help or use a localized build of MicroCode. - -## My micro:bit froze and is showing a number - -This typically means that MicroCode had a bug and crashed. Here are a few common error codes that are scrolled on the screen: - -- **540**: The .hex download was interrupted or failed. Try downloading the .hex file again. -- **020**: Out of memory! Your program is so big that it does not fit in memory anymore... or we have a memory leak somewhere. Try resetting the micro:bit. - -Other error codes are [documented in MakeCode](https://makecode.microbit.org/device/error-codes). - -## How do I add support for my robot? - -If your robot is not [listed](./robots-supported), follow the [instructions](./robots-supported#new-robot) to get it added to the list. - -## Can I help? - -Yes! MicroCode is open source at https://github.com/microsoft/microcode. +MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/faq](here) \ No newline at end of file diff --git a/docs/jacdac.md b/docs/jacdac.md index 4c751d08..73e3da48 100644 --- a/docs/jacdac.md +++ b/docs/jacdac.md @@ -3,40 +3,4 @@ title: Jacdac image: ./docs/images/generated/sample_railroad_crossing.png --- -# Jacdac - -![Smiley Button MicroCode program](./images/generated/sample_railroad_crossing.png){:class="screenshot"} - -MicroCode will detect [Jacdac](https://aka.ms/jacdac) modules and automatically display tiles for some of them. Tiles are available for all modules in [Kittenbot Jacdac Kit A](https://microsoft.github.io/jacdac-docs/devices/kittenbot/jacdacstarterkitawithjacdaptorformicrobitv2v10/), -as as well as the [Forward Education Climate Kit](https://microsoft.github.io/jacdac-docs/devices/forward-education/climateactionkitv10/). Many of the modules in [Kittenbot Jacdac Kit B](https://microsoft.github.io/jacdac-docs/devices/kittenbot/jacdacdeveloperstoolelectronicmodulekitbv10/) also are supported. - -Programming tiles for Jacdac modules appear in the user interface when the modules are connected to the shield. The Jacdac tiles have a small yellow square in the lower-right corner. - -### WHEN modules - -#### Sensors - -- ![magnet sensor](./images/generated/icon_S10.png){:class="icon"} `magnet sensor` detects the presence of a magnet (levels 1 - 5, where 1 means no magnet present and 5 means strong presence of magnetic field) -- ![light sensor](./images/generated/icon_S5.png){:class="icon"} `light sensor` measures the amount of light (levels 1 - 5, where 1 means little light present and 5 means a lot of light present) -- ![moisture sensor](./images/generated/icon_S16.png){:class="icon"} - measures the amount of moisture (levels 1 - 5, where 1 means very dry and 5 means very wet) -- ![distance sensor](./images/generated/icon_S17.png){:class="icon"} `distance sensor` measures the distance to an object (levels 1 - 5, where 1 means very close and 5 means far away) -- ![line sensor](./images/generated/icon_S18.png){:class="icon"} `line sensor` detects - whether the surface under the sensor is dark or light - -#### User inputs - -- ![slider](./images/generated/icon_S11.png){:class="icon"} `slider` measures the position of a physical slider (1-5, where 1 is minimum position and 5 is maximum position) -- ![dial](./images/generated/icon_S12.png){:class="icon"} `dial` has two associated events: turn left ![turn left](./images/generated/icon_F21L.png){:class="icon"} and turn right ![turn right](./images/generated/icon_F21R.png){:class="icon"} -- ![key](./images/generated/icon_F5.png){:class="icon"} `key` is available in the press/release event. - -### DO modules - -- ![LED](./images/generated/icon_A8.png){:class="icon"} `LED` set a color animation on a programmable LED strip -- ![relay tile](./images/generated/icon_A22.png){:class="icon"} `relay` controls a relay switch (turning it on or off) -- ![servo power tile](./images/generated/icon_A23.png){:class="icon"} `servo power` controls the power to a servo motor (turning it on or off) -- ![servo set angle tile](./images/generated/icon_A21_.png){:class="icon"} `set servo angle` controls the orientation of a servo motor arm. The ![servo set angle tile](./images/generated/icon_A21_.png){:class="icon"} `servo` arm orientation is mapped to the wall clock hours: `0` (or `12`) is on rotated 90 degree from the resting position to the left, `6` is rotated 90 degree right from the rest position. This operation depends on the servo being powered on. - -### Jacdac samples - -See the [following programs](./samples.md#jacdac) for examples of how to use Jacdac modules with MicroCode. +MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/jacdac](here) \ No newline at end of file diff --git a/docs/language.md b/docs/language.md index 3e333b4d..9d125343 100644 --- a/docs/language.md +++ b/docs/language.md @@ -4,249 +4,4 @@ image: ./docs/images/generated/sample_smiley_buttons.png description: Documentation of the MicroCode programming language. --- -The MicroCode language is defined in terms of **pages**, where a page has a list of **rules**, -and each rule consists of a **When** section and a **Do** section, each with a list of programming -**tiles**. - -MicroCode supports events, conditions on the events, sequencing, -loops, variables, and simple arithmetic (addition, for now) over constants and variables. -See [samples](./samples) for a list of annotated examples. - -The picture below shows a 1-page program with four rules. - -![Smiley Button MicroCode program](./images/generated/sample_smiley_buttons.png){:class="screenshot"} - -The first two rules run when A is pressed. - -![when button A pressed, show image smiley](./images/generated/sample_smiley_buttons_page_1_rule_1.png){:class="rule"} - -- **when** ![press](./images/generated/icon_S2.png){:class="icon"} press ![button A](./images/generated/icon_F3.png){:class="icon"} button A, **do** ![screen](./images/generated/icon_A5.png){:class="icon"} show image smiley. - -![when button A pressed, play happy sound](./images/generated/sample_smiley_buttons_page_1_rule_2.png){:class="rule"} - -- **when** ![press](./images/generated/icon_S2.png){:class="icon"} press ![button A](./images/generated/icon_F3.png){:class="icon"} button A, **do** ![speaker](./images/generated/icon_A2.png){:class="icon"} play sound emoji ![emoji happy](./images/generated/icon_M19happy.png){:class="icon"} happy. - -The other rules are similar but trigger for button B. - -## Pages and rule execution {#pages} - -Execution of the MicroCode program starts on ![page 1](./images/generated/icon_M1.png){:class="icon"} page 1. All the rules on that page are active. Rules on another page only become active when the program switches to that page -(via an explicit ![switch page](./images/generated/icon_A1.png){:class="icon"} switch-page command, discussed later). -Any rules that might still be executing on the current page (like an animation in a loop) are terminated before -the page switch takes place (you can never have rules from different pages executing at the same time). - -![Hot potato sample](./images/generated/sample_hot_potato.png){:class="screenshot"} - -### Events and rule ordering - -Events are processed by MicroCode one at a time. For example, if you push the A and B buttons at (roughly) -the same time, then MicroCode will process either A before B or it will process B before A. -Given an event, MicroCode processes the event by executing the rules for that event in the -order they appear on the current page. For each rule, this means evaluating if the conditions -on the event in the `When` section hold and, if so, starting the rule's `Do` section. - -### Rule termination - -Most of the commands in the `Do` section complete quickly, such as assigning a value to a variable; -others, like the display of a sequence of images take time proportional to sequence's length; -furthermore, an animation or sound sequence can be repeated multiple times -(or without bound) using a repeat tile. In the case of an animation, a currently -running rule that is using the micro:bit screen -will be terminated if a new rule that also uses the micro:bit screen is started. - -## WHEN section {#when} - -The left-hand side of a rule, the `When` section, starts with an -**event** tile from the following dialog, which appears when you select the leftmost empty tile of a rule: - -![event tiles in when section](./images/whenDialog.jpg){:class="screenshot"} - -- ![press image](./images/generated/icon_S2.png){:class="icon"} `press` of button, micro:bit icon, or pin -- ![release image](./images/generated/icon_S2B.png){:class="icon"} `release` of button, micro:bit icon, or pin -- ![move image](./images/generated/icon_S3.png){:class="icon"} `move` of accelerometer, in various ways -- ![hear image](./images/generated/icon_S8.png){:class="icon"} measures the amount of sound in the environment (levels 1-5, where 1 is quiet and 5 is very loud); it also can respond to a quick/loud sound (event) -- ![temperature change image](./images/generated/icon_S6.png){:class="icon"} `temperature change`, either `warmer` or `colder -- ![light sensor](./images/generated/icon_S15.png){:class="icon"} `light sensor` measures the amount of light (levels 1 - 5, where 1 means little light present and 5 means a lot of light present)`, using the micro:bit's LED matrix! -- ![radio receive image](./images/generated/icon_S7.png){:class="icon"} `radio receive` of a number -- ![start page image](./images/generated/icon_S1.png){:class="icon"} `start page` only runs when the page is started (or switched to), with an optional delay -- ![timer image](./images/generated/icon_S4.png){:class="icon"} `timer` of a time -- ![variable X image](./images/generated/icon_S9A.png){:class="icon"} ![variable Y image](./images/generated/icon_S9B.png){:class="icon"} ![variable Z image](./images/generated/icon_S9C.png){:class="icon"} `variable (X,Y,Z) changed` to a number - -If the `when` section is left empty, -the rule will run once when the page is started. - -### Event parameters and conditions - -An event tile can be followed by none, one or more parameter tiles which determines the conditions under which execution will proceed from the **When** section to the **Do** section, Every event has a default parameter, which is used when no parameter is specified. The defaults are: - -- ![press](./images/generated/icon_S2.png){:class="icon"} `press`, defaults to `button A` ![press image](./images/generated/icon_F3.png){:class="icon"}; - other options include `button B` ![press image](./images/generated/icon_F4.png){:class="icon"}, - `micro:bit logo` ![press image](./images/generated/icon_F7.png){:class="icon"}, - `pin 0` ![press image](./images/generated/icon_F0.png){:class="icon"}, - `pin 1` ![press image](./images/generated/icon_F1.png){:class="icon"}, `pin 2` ![press image](./images/generated/icon_F2.png){:class="icon"} -- ![release](./images/generated/icon_S2B.png){:class="icon"} `release`, defaults and options are the same as for `press` - -The dialog below shows the parameters associated with the button press/release events. - -![parameters for press/release event](./images/eventParameterDialog.jpg){:class="screenshot"} - -- ![accelerometer](./images/generated/icon_S3.png){:class="icon"} `move`, defaults to ![shake](./images/generated/icon_F17_shake.png){:class="icon"} `shake`; other options include ![tilt up](./images/generated/icon_F17_tilt_up.png){:class="icon"} `tilt up`, ![tilt down](./images/generated/icon_F17_tilt_down.png){:class="icon"} `tilt down`, ![tilt left](./images/generated/icon_F17_tilt_left.png){:class="icon"} `tilt left` and ![tilt right](./images/generated/icon_F17_tilt_right.png){:class="icon"} `tilt right` -- ![hear image](./images/generated/icon_S8.png){:class="icon"} `hear` defaults to quick/loud event -- ![temperature change](./images/generated/icon_S6.png){:class="icon"} `temperature change`, either 1 degree (Celcius) `warmer` - ![warmer](./images/generated/icon_F22U.png){:class="icon"} or `colder` - ![colder](./images/generated/icon_F22D.png){:class="icon"} - (defaults to `warmer`) -- ![light sensor](./images/generated/icon_S15.png){:class="icon"} `light sensor` defaults to value 1 (least light); other options include 2, 3, 4, and 5 (most light) -- ![radio receive](./images/generated/icon_S7.png){:class="icon"} `radio receive`, defaults to `any` -- ![timer](./images/generated/icon_S4.png){:class="icon"} `timer`, defaults to `1/4 second` -- ![variable X image](./images/generated/icon_S9A.png){:class="icon"} `variable (X,Y,Z) changed`, defaults to `any` (any value change triggers it) - -### Conditions on event values - -When an event carries a numeric value (in the case of receiving a radio message or a variable being updated), if that value is equal to the sum of the values (constants and variables) that follows, then execution will proceed to the DO section. Here are the five available (dot) values: - -- `1 dot` ![one dot](./images/generated/icon_F8.png){:class="icon"} -- `2 dots`: ![two dots](./images/generated/icon_F9.png){:class="icon"} -- `3 dots`: ![three dots](./images/generated/icon_F10.png){:class="icon"} -- `4 dots`: ![four dots](./images/generated/icon_F11.png){:class="icon"} -- `5 dots`: ![five dots](./images/generated/icon_F12.png){:class="icon"} - -The `timer` is parameterized with various times that can also be sequenced and summed: - -- `1/4 second`: ![1/4 second](./images/generated/icon_F13.png){:class="icon"} -- `1 second`: ![1 second](./images/generated/icon_F14.png){:class="icon"} -- `5 seconds`: ![5 seconds](./images/generated/icon_F19.png){:class="icon"} -- `? seconds`: ![0 to 1 second, chosen randomly](./images/generated/icon_F18.png){:class="icon"} - 0 to 1 second, chosen randomly - -In the case of the timer, the sum specifies the amount of time to start the timer with. - -![command tiles in do section](./images/doDialog.jpg){:class="screenshot"} - -## DO section {#do} - -The right-hand side of a rule, the **Do** section, starts with a -**command** tile from the following list: - -- ![screen](./images/generated/icon_A5.png){:class="icon"} `show image` shows an animation sequence on the LED screen. -- ![show number](./images/generated/icon_A10.png){:class="icon"} `show number` shows a numeric value between 0 and 99 -- ![speaker](./images/generated/icon_A2.png){:class="icon"} `sound emoji` plays a sequence of emojis -- ![play notes](./images/generated/icon_A4.png){:class="icon"} `play notes` plays a sequence of notes (from the C major scale) -- ![radio send](./images/generated/icon_A6.png){:class="icon"} `radio send` sends a given number over the radio -- ![radio set group](./images/generated/icon_A6A.png){:class="icon"} `radio set group` takes a number and ensures that radio messages from a different group number are ignored (the default radio group is 1, which means all micro:bits see all messages) -- ![switch page](./images/generated/icon_A1.png){:class="icon"} `switch page` transfers execution control to a given page -- ![set variable X](./images/generated/icon_A9A.png){:class="icon"} `set variable` puts a number into a variable (`X`, `Y`, `Z`); defaults to 0 if no value specified; also ![set variable U](./images/generated/icon_A9B.png){:class="icon"} and ![set variable Z](./images/generated/icon_A9C.png){:class="icon"} - -A command can be followed by various parameter tiles, depending on the type -of command. As with events, every command has a default parameter, for the -case where no parameter tile is given: - -- ![screen](./images/generated/icon_A5.png){:class="icon"} `screen` shows a `happy face` by default -- ![speaker](./images/generated/icon_A2.png){:class="icon"} `sound emoji` plays ![emoji giggle](./images/generated/icon_M19giggle.png){:class="icon"} `giggle` by default -- ![radio send](./images/generated/icon_A6.png){:class="icon"} `radio send` sends the number `1` by default -- ![switch page](./images/generated/icon_A1.png){:class="icon"} `switch page` switches to page `1` by default -- ![get variable X](./images/generated/icon_M20A.png){:class="icon"} `get variable` gets the number from a variable (`X`, `Y`, `Z`); defaults to `0` if variable wasn't previously set. Also - ![get variable Y](./images/generated/icon_M20B.png){:class="icon"} - and ![get variable Z](./images/generated/icon_M20C.png){:class="icon"} - -### Asset editors - -Two editors are provided to allow the creation of 5x5 LED images and simple melodies. - -#### LED image editor - -THe LED image editor lets you select which LEDs are on/off for a frame of an animation. You can continue to add LED images in a sequence (the editor will make a copy of the last image): - - - -#### Melody editor - -The melody editor lets you compose a four note sequence, where each note can be C,D,E,F, or G: - - - -### Constructing numbers - -For commands that expect a numeric value (![radio send](./images/generated/icon_A6.png){:class="icon"} `radio send`, ![in variable X](./images/generated/icon_M20A.png){:class="icon"} `set variable`), a variety of tiles are available - -- the **constant values** ![value 1](./images/generated/icon_M6.png){:class="icon"} 1, 2, 3, 4 and 5 dots -- the **values of variables** ![out of variable X](./images/generated/icon_S9A.png){:class="icon"} `X`, `Y`, and `Z` -- the **value of the radio receive event** ![value of radio receive event](./images/generated/icon_M21.png){:class="icon"}, only available if **WHEN** section has radio receive event ![radio receive event](./images/generated/icon_S7.png){:class="icon"} -- the **value of the temperature sensor** ![value of temperature sensor](./images/generated/icon_M25.png){:class="icon"}, always available -- a ![dice](./images/generated/icon_M22.png){:class="icon"} **random number generator** yields a random integer between `1` and `5` (inclusive) by default - -### ![repeat](./images/generated/icon_M23.png){:class="icon"} `repeat` (loops) {#loops} - -A ![repeat](./images/generated/icon_M23.png){:class="icon"} `repeat` tile -can be added to certain commands to repeat the entire **DO** section. The value tiles -after `repeat` determine the number of iterations. If no value is given, it repeats forever. - -![when touch logo, print happy on screen](./images/generated/sample_pet_hamster_page_1_rule_2.png){:class="rule"} - -- **when** ![press](./images/generated/icon_S2.png){:class="icon"} press ![logo](./images/generated/icon_F7.png){:class="icon"} micro:bit logo, **do** ![screen](./images/generated/icon_A5.png){:class="icon"} show image happy animation and ![repeat](./images/generated/icon_M23.png){:class="icon"} repeat ![value 3](./images/generated/icon_M8.png){:class="icon"} 3 times. - -## Jacdac {#jacdac} - -MicroCode will detect connected [Jacdac](./jacdac) modules and automatically display programming tiles for them. Tiles are available for all modules in [Kittenbot Jacdac Kit A](https://microsoft.github.io/jacdac-docs/devices/kittenbot/jacdacstarterkitawithjacdaptorformicrobitv2v10/), -as as well as the [Forward Education Climate Kit](https://microsoft.github.io/jacdac-docs/devices/forward-education/climateactionkitv10/). Many of the modules in [Kittenbot Jacdac Kit B](https://microsoft.github.io/jacdac-docs/devices/kittenbot/jacdacdeveloperstoolelectronicmodulekitbv10/) also are supported. - -## Robot {#robot} - -MicroCode can be used to control a micro:bit robot ([read more](./robot)). Make sure to start your program by setting the same radio group as the robot. - -![setting radio group 3 on page start](./images/generated/sample_robot_shake_page_1_rule_1.png){:class="rule"} - -### DO section - -The ![robot](./images/generated/icon_CAR.png){:class="icon"} `robot` starts the robot motor commands. Any of those can be sequenced in the same rule. - -- ![robot forward](./images/generated/icon_CAR1.png){:class="icon"} `forward`, instructs the robot to move forward. -- ![robot fast forward](./images/generated/icon_CAR6.png){:class="icon"} `fast forward`, instructs the robot to move forward at maximum speed -- ![robot backward](./images/generated/icon_CAR2.png){:class="icon"} `reverse`, instructs the robot to move backward -- ![robot turn left](./images/generated/icon_CAR3.png){:class="icon"} `turn left`, instructs the robot to turn left -- ![robot spin left](./images/generated/icon_CAR7.png){:class="icon"} `spin left`, instructs the robot to spin left -- ![robot turn right](./images/generated/icon_CAR4.png){:class="icon"} `turn right`, instructs the robot to turn right. -- ![robot spin right](./images/generated/icon_CAR8.png){:class="icon"} `spin right`, instructs the robot to spin right -- ![robot stop](./images/generated/icon_CAR5.png){:class="icon"} `stop`, instructs the robot to stop - -The robot had LEDs that can be controlled as well. - -- ![LED color red](./images/generated/icon_CAR9.png){:class="icon"} `LED red`, turns LED to red -- ![LED color green](./images/generated/icon_CAR10.png){:class="icon"} `LED green`, turns LED to green -- ![LED color blue](./images/generated/icon_CAR11.png){:class="icon"} `LED blue`, turns LED to blue -- ![LED OFF](./images/generated/icon_CAR12.png){:class="icon"} `LED OFF`, turns LEDs OFF - -Some robot have an optional robotic arm. - -- ![arm open](./images/generated/icon_CAR13.png){:class="icon"} `arm open`, opens the arm -- ![Aarm close](./images/generated/icon_CAR14.png){:class="icon"} `arm close`, closes the arm - -![A rule with a sequence of motor commands](./images/generated/sample_robot_avoid_wall_page_1_rule_3.png){:class="rule"} - -The robot will automatically slow down when it detects a line; unless you are running it in -fast forward. This greatly stabilizes line following algorithms. - -### WHEN section - -The robot distance sensor -is exposed as a wall tile; -and the line sensor as a line tile. - -- ![wall](./images/generated/icon_S13.png){:class="icon"} `wall detected`, triggers when an obstacle is detected; - (levels 1 - 5, where 1 means obstacle close, 5 means far away in multiple of 5cm) - -Line detection is typically done with two infrared sensors under the robot. - -- ![line](./images/generated/icon_S14.png){:class="icon"} `line change detected` - -There are 3 cases when a line is detected: - -- ![both line detected](./images/generated/icon_F23B.png){:class="icon"} both, -- ![left line detected](./images/generated/icon_F23L.png){:class="icon"} left, -- ![right detected](./images/generated/icon_F23R.png){:class="icon"} right. - -There are 3 possible state when the line detector is not detected: - -- ![no line from left](./images/generated/icon_F23NL.png){:class="icon"} no line detected coming from a left line, -- ![no line from left](./images/generated/icon_F23NR.png){:class="icon"} no line detected coming from a right line, -- ![no line detected](./images/generated/icon_F23N.png){:class="icon"} no line detected - coming from both lines, +MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/language](here) \ No newline at end of file diff --git a/docs/localization.md b/docs/localization.md index c6268466..22845520 100644 --- a/docs/localization.md +++ b/docs/localization.md @@ -4,16 +4,4 @@ image: ./docs/images/localization.png description: Instruction to help localize MicroCode --- -![Play hello sound in zh-CH](./images/localization.png){:class="screenshot"} - -You can point directly to a localized by doing `/` like `/fr` (case-sensitive). - -The list of supported languages is available in the [User Guide](./manual#localization). - -## Helping with translations - -The localization is handled through [Crowdin](https://crowdin.com). You will need to get a translator account to get started. - -- **[translate all strings](https://crowdin.com/translate/makecode/12054)** - -Once your translations are added, someone will have to approve if you are a proofreader, go ahead and approve them. Then send us a comment on the crowdin message board to refresh the build. +MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/localization](here) \ No newline at end of file diff --git a/docs/manual.md b/docs/manual.md index ae8df667..079836c4 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -4,157 +4,4 @@ image: ./docs/images/generated/sample_smiley_buttons.png description: User guide for the MicroCode editor --- -{% include youtube.html id="g53_aEVH8oA" %} - -MicroCode makes it possible to program the [micro:bit V2](https://microbit.org) -**without the need for an extra computer or Internet connection**. -As shown above, the micro:bit slots into a (commercially available) shield that provides a color display and extra inputs. -The MicroCode visual programming model is based on Kodu and targets children age 6-9, younger than the traditional audience for the micro:bit. MicroCode features: - -- [arcade shields](./purchase#arcade-shields) for the micro:bit V2 enable "on the go" programming with familiar game console controls -- kid-friendly, icon-based, structured code editor and [programming language](./language) -- lots of [sample programs](./samples) to get started -- [translated](#localization) in 20+ languages -- remote control a [micro:bit robot](./robot) using MicroCode - to follow lines, avoid obstacles and more. -- extend and program your creation with [Jacdac accessories](#jacdac) (LEDs, servos, ...) - -## Purchasing the hardware - -All the above hardware can be [purchased](./purchase.md) from a variety of vendors. - -## Getting started - -Regardless of whether you are using the Arcade shield or web app, you first need to download the (localized) MicroCode hex file to your micro:bit V2. There are two ways to do this: - -1. visit the [web app](https://microsoft.github.io/microcode/) and follow directions to connect your micro:bit and [automatically download over WebUSB](#download) -2. visit the [localization](#localization) section to _download_ the MicroCode hex file to your computer and copy to your micro:bit V2 (plugged into your computer via USB). - -## Hands-on resources - -The following resources may be helpful to print out: - -- [MicroCode Quick Start Guide](./handouts/quickstart.pdf) -- [MicroCode 101 Slides](./ppt/MicroCode101.pptx) -- [MicroCode Programming Cards (Basic)](./ppt/MicroCodeCardsBasic.pptx) -- [MicroCode Programming Cards (Full)](./ppt/MicroCodeCardsFull.pptx) - -## micro:bit Robots {#robots} - -Remote control a [micro:bit robot](./robot) using MicroCode -to follow lines, avoid obstacles and more. - -[![Photograph of the Cutebot](./images/mcrc.jpg){:class="photo"}](./robot) - -## Jacdac accessories {#jacdac} - -[![Photograph of Jacdac kits](./images/JacdacKits.png){:class="photo"}](./jacdac) - -MicroCode recognizes many commercially-available -[Jacdac modules](./jacdac) that allow you to extend the micro:bit device with LEDs, servos, and much more. -In this video, we launch an LED animation when a clap is detected. - - - -## Localization {#localization} - -MicroCode is community translated through Crowdin. Please read on [localization](./localization) to get started. - -- [Basque](../eu.html) ([download](../assets/hex/microcode-eu.hex)) -- [Catalan](../ca.html) ([download](../assets/hex/microcode-ca.hex)) -- [Chinese (Simplified)](../zh-CN.html) ([download](../assets/hex/microcode-zh-cn.hex)) -- [Chinese (Traditional))](../zh-HK.html) ([download](../assets/hex/microcode-zh-hk.hex)) -- [Croatian](../hr.html) ([download](../assets/hex/microcode-hr.hex)) -- [Dutch](../nl.html) ([download](../assets/hex/microcode-nl.hex)) -- [English](../) ([download](../assets/hex/microcode-en.hex)) -- [German](../de.html) ([download](../assets/hex/microcode-de.hex)) -- [Filipino](../fil.html) ([download](../assets/hex/microcode-fil.hex)) -- [French](../fr.html) ([download](../assets/hex/microcode-fr.hex)) -- [French (Canada)](../fr-CA.html) ([download](../assets/hex/microcode-fr-ca.hex)) -- [Italian](../it.html) ([download](../assets/hex/microcode-it.hex)) -- [Japanese](../ja.html) ([download](../assets/hex/microcode-ja.hex)) -- [Korean](../ko.html) ([download](../assets/hex/microcode-ko.hex)) -- [Polish](../pl.html) ([download](../assets/hex/microcode-pl.hex)) -- [Portuguese (Brazil)](../pt-BR.html) ([download](../assets/hex/microcode-pt-br.hex)) -- [Russian](../ru.html) ([download](../assets/hex/microcode-ru.hex)) -- [Spanish](../es-ES.html) ([download](../assets/hex/microcode-es-es.hex)) -- [Spanish (Mexico)](../es-MX.html) ([download](../assets/hex/microcode-es-mx.hex)) -- [Turkish](../tr.html) ([download](../assets/hex/microcode-tr.hex)) -- [Welsh](../cy.html) ([download](../assets/hex/microcode-cy.hex)) - -## Web editor - - - -The MicroCode web editor is at [https://microsoft.github.io/microcode/](https://microsoft.github.io/microcode/). -We recommend using the keyboard navigation: - -- `Left`, `Right`, `Up`, `Down` moves the cursor - - the `Left` and `Right` keys will wrap around in the editor on the **same** page - - the `Up` key on top of the screen will act as `back`. It will go back the pages until page 1 is in focus, then pressing up will go back to the start screen. - - the `Down` key will wrap around the pages -- `Enter` or `Space` for `A` button -- `Backspace` for `B` button -- `]` or `Page Up` to go to the next page, `[` or `Page Down` to go to the previous page -- Copy the URL to share your program. - -### Automatic download to micro:bit V2 {#download} - -When the editor does not detect any micro:bit, it will automatically prompt you with instructions -on how to connect. Once your micro:bit V2 is paired, the web editor will be able to download your -MicroCode program to your micro:bit. This happens on every edit, so your program -is always up-to-date (and running)! - -> If your micro:bit disconnects, you will see a micro:bit icon show up on the upper left corner of the editor. Click on that button to reconnect again. - -### Accessibility - -We want to make the editor as accessible as possible; please send us suggestions to improve its accessibility. - -#### Keyboard navigation - -MicroCode can be accessed with the keyboard: - -- Arrow keys to move cursor -- `Enter` or `Space` for `A` button -- `Backspace` for `B` button -- Keep moving the cursor `Up` to go back a screen, if `Backspace` is not available; - for example, if you are using a 5-input switch panel. -- Keep moving `Right` or `Left` to wrap around the user interface; for example, - if you are using a 2-input switch panel. - -#### Gamepads - -MicroCode supports game console controllers compatible with [Web Gamepad](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad). - -#### Screen reader - -The editor integrates with existing screen readers, like NVDA. - -#### Tooltip read aloud - -By clicking on the `tooltip reader` button at the bottom of the editor, the tooltips will be read aloud. This may be useful for students who are still learning to read. - -### Program slots ![disk icon 1](./images/generated/icon_disk1.png) ![disk icon 2](./images/generated/icon_disk2.png) ![disk icon 3](./images/generated/icon_disk3.png) {#program-slots} - -There are three slots for saving user programs for later load/restore. From the editor, click on the disk icon -![disk icon](./images/generated/icon_disk.png) -in the upper left to select which slot to save the current program to. From the home screen, select the disk icon to load a program from one of the three save slots. - -## Community - -- [KittenBot MicroCode introduction](https://mp.weixin.qq.com/s/yBQMU2IAbeHgr-ok05THTA) - -{% include youtube.html id="mbF-HU9IZ-A" %} - -- Microsoft Garage for kick starting this project during the 2022 Microsoft Hackathon. -- [@loretod101](https://twitter.com/loretod101) on advising on accessibility features, including switch access support. -- [@BillSeiver](https://twitter.com/BillSiever) on feedback for tiles, including the `page start` tile -- [@eliseli\_](https://twitter.com/eliseli_) for the Spanish translation - -## Contributing - -- Post your suggestions or questions at [https://forum.makecode.com/c/60](https://forum.makecode.com/c/60). - -This project is open source and welcomes contributions and suggestions at https://github.com/microsoft/microcode. -Read the [developer instructions](./develop.md). +MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/manual](here) \ No newline at end of file diff --git a/docs/purchase.md b/docs/purchase.md index 69016349..e0ec98c4 100644 --- a/docs/purchase.md +++ b/docs/purchase.md @@ -1,89 +1,4 @@ --- title: Purchasing Hardware --- - -## Portable programming - -To run MicroCode (without a separate computer such as a laptop, desktop, tablet, smartphone) you need to get the following hardware: - -- a micro:bit V2, available from many [vendors](https://microbit.org/buy/) -- a micro:bit [Arcade shield](#arcade-shields) - -With the above hardware, in addition to the freely-available MicroCode software, you can also make use -of these other great programming environments: - -- [MakeCode for micro:bit](https://makecode.microbit.org) for the micro:bit V2 -- [MakeCode Arcade](https://arcade.makecode.com) for the micro:bit V2 + Arcade shield - -## Tethered programming - -If you only have a micro:bit V2, you can still use MicroCode, but you need to use the [web app](https://microsoft.github.io/microcode/) and connect your micro:bit using a micro-USB cable. - -## KittenBot MicroCode product - -KittenBot recently introduced a [MicroCode Explorer Kit](https://www.kittenbot.cc/products/kittenbot-microcode-explorer-kit-computer-free-programming) that includes a micro:bit V2, newbit Arcade shield, Jacdac Kit A. - -## Arcade Shields for the micro:bit V2 - -Three Arcade shields for the micro:bit V2 are available on the market today, as shown below: - - - - - - - - - - - - - - -
- -Kittenbot's newbit Arcade shield - - - -ELECFREAK's micro:bit Arcade shield - - - -ICShopping's Game:bit Arcade shield - -
- - - - - - - - - - - -
- -Small screen. No battery or battery pack included. 3.7V JST power jack on back. One Jacdac port. - - - -Assembly required. Small screen. AAA Battery pack on back. One Jacdac port. - - - -No assembly required. Large screen and 3d-printed enclosure with LiPo battery inside. Two Jacdac ports. - -
- After downloading the MicroCode hex file to your micro:bit V2, whenever you plug the micro:bit into the Arcade Shield, MicroCode should start running. Your MicroCode program is always live and runnable. Once you remove the micro:bit from the shield, the program will persist and continue to run (assuming the micro:bit is still powered, of course). - -## Jacdac and Robots - -If you want to use [Jacdac](./jacdac) accessories with MicroCode, you will also need a kit of Jacdac modules (see [Jacdac Kit A](https://microsoft.github.io/jacdac-docs/devices/kittenbot/jacdacstarterkitawithjacdaptorformicrobitv2v10/), [Jacdac Kit B](https://microsoft.github.io/jacdac-docs/devices/kittenbot/jacdacdeveloperstoolelectronicmodulekitbv10/), [Climate Action Kit](https://microsoft.github.io/jacdac-docs/devices/forward-education/climateactionkitv10/)). If you further want to use MicroCode with a [supported micro:bit robot](./robots-supported.md), you will also need to purchase the robot, as well as an _additional micro:bit_ for slotting into the robot. - -Both Jacdac and the micro:bit robots also are supported by [MakeCode for micro:bit](https://makecode.microbit.org). For more info, see: - -- [Jacdac MakeCode integration](https://microsoft.github.io/jacdac-docs/clients/makecode/) -- [MakeCode micro:bit robot extension](https://makecode.microbit.org/pkg/microsoft/microbit-robot) +MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/purchase](here) \ No newline at end of file diff --git a/docs/robot.md b/docs/robot.md index b84b8518..7cd64b49 100644 --- a/docs/robot.md +++ b/docs/robot.md @@ -2,81 +2,4 @@ ![Photograph of micro:bit robots](./images/robots.jpg) -There are many [BBC micro:bit robot accessories](https://microbit.org/buy/accessories/?category=Robotics), which the micro:bit slots into to provide a "programmable robot brain". We have worked with a [handful of these robots](./robots-supported.md) to develop a platform approach that will make it simpler for teachers and students to work with a wide variety of micro:bit robots. Our hope is that all micro:bit robots will eventually be supported by this platform. - -The platform is based on a robust robot controller, written using MakeCode, that runs on the robot (micro:bit V1 or V2) and exposes a radio protocol to communicate with another micro:bit, running the user's program. The robot controller code is written using MakeCode for the micro:bit and has a common set of programming blocks. - -![A diagram showing how MicroCode is communicating with the robot](./images/mcrc.jpg) - -## Robot features - -- **Two motors** - the robot controller can drive two motors independently, allowing the robot to move forward, backward, turn left and right. Microcode provides a calibration feature to compensate for motor drift, and smooth acceleration and deceleration. -- **Line sensors** - the robot controller can read the state of two line sensors, allowing the robot to follow a line. Microcode provides enhanced line following features, including tracking transition to help with line following algorithms. -- **Sonar** - the robot controller can read the distance from a sonar sensor, allowing the robot to avoid obstacles. The library has a builtin filtering feature to reduce sensor noise. -- **Radio** - the robot controller can communicate with another micro:bit using the radio, allowing the user's program to control the robot. -- **Universal MakeCode blocks** for all robots: the robot controller exposes a common set of programming blocks, allowing the user's program to work with any robot that supports the platform. -- Supports micro:bit V1: Recycle your micro:bit as robot controllers! - -## MicroCode programming - -MicroCode provides a simplified programming experience for robots that are equipped with two motors, sonar and line sensors. The user's code can be updated very quickly using the Arcade shield. - -![robot blocks showcase](./images/generated/sample_robot_showcase_page_1.png){:class="sample"} - -## Preparing the robot micro:bit - -You will need one of the **[supported micro:bit robots](./robots-supported.md)** and an extra micro:bit (v1 or v2) to run on the robot. - -### Configuring the radio group - -The MicroCode editor and the robot micro:bit communicate using the radio. These are the steps to configure the robot and the MicroCode: - -On the robot micro:bit, - -- Reset the robot micro:bit and note the radio group, -- If you need to change the group number, press button `A+B` to enter the configuration mode until your see `RADIO ...` message. -- Press `A` or `B` to increase or decrease the radio group. - -The radio group is stored in the flash of the micro:bit and will be used every time the robot is reset. (However, it will be erased if you download another .hex file). - -On the MicroCode side, - -- Use the ![radio set group](./images/generated/icon_A6A.png){:class="icon"} `radio set group` to configure the same group number as the robot micro:bit - -![setting radio group 3 on page start](./images/generated/sample_robot_shake_page_1_rule_1.png){:class="rule"} - -### Calibrating motor drift - -It is not uncommon for 2 wheeled robot to slightly drift towards one side. To correct this behavior, you can configure a drift parameter on the robot. - -On the robot micro:bit, - -- Press `A+B` to switch to configuration mode, until you see the `DRIFT ...` message. -- Let the robot go forward until it goes as straight as possible by pressing A and B to increase or modify the drift. - -![robot drift tester](./images/generated/sample_robot_drift_tester_page_1.png){:class="sample"} - -The robot drift tester program above lets you test the drift for medium and high speeds. Clap or shoot to stop the robot. - -The drift value will be stored in the flash of the micro:bit and will be used every time the robot is reset. -(However it will be erased if you download another .hex file, so you might want to write it down somewhere). - -## Tiles - -The tiles are documented -in the [language robot section](./language#robot). - -## Samples - -The samples are listed on the [samples page](./samples.md#robot). - -## Troubleshooting - -This is a quick check list to make sure you have the best experience with the MicroCode robot: - -- **Charge your batteries** - everything starts to fall apart once the battery level gets low! Keep those batteries topped off! -- **Double check the radio groups** - make sure the MicroCode program and the robot are on the same radio group - -## Add your robot {#contribute} - -We accept pull requests to add new robots. See the [contributing](./robots-supported.md) page for more details. +MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/robot](here) \ No newline at end of file diff --git a/docs/robots-supported.md b/docs/robots-supported.md index aa561672..0a1e7469 100644 --- a/docs/robots-supported.md +++ b/docs/robots-supported.md @@ -1,140 +1,3 @@ ## Supported robots -MicroCode supports the following [robots](./robot.md): - -- [DFRobot Maqueen](#dfrobot-maq) -- [DFRobot Maqueen Plus](#dfrobot-maq-plus) -- [Elecfreaks Cutebot](#cutebot) -- [Elecfreaks Cutebot PRO](#cutebot-pro) -- [Forward Educations Smart Vehicle Kit](#forward-education-smart-vehicle-kit) -- [InkSmith K8](#inksmith-k8) -- [KeyStudio KS0426 Mini Smart Robot](#keystudio-mini) -- [KittenBot MiniLFR](#kittenbot-mlfr) -- [KittenBot Robotbit](#kittenbot-robotbit) -- [KittenBot Nanobit](#kittenbot-nanobit) -- [Yahboom Tiny:bit](#yahboom) - -Please file a [GitHub issue](https://github.com/microsoft/microcode/issues?q=is%3Aissue+is%3Aopen+label%3Arobot) if your robot is not listed. -See [how to contribute](#contributing) for more information. - -### DFRobot Maqueen V2+ {#dfrobot-maq} - -![Photograph of the Maqueen](./images/maqueen.jpeg){:class="photo"} - -- [Home](https://wiki.dfrobot.com/micro_Maqueen_for_micro_bit_SKU_ROB0148-EN) -- [Download for micro:bit V1](https://microsoft.github.io/microbit-robot/assets/dfrobot-maqueen-for-microbit-v1.hex) -- [Download for micro:bit V2](https://microsoft.github.io/microbit-robot/assets/dfrobot-maqueen-for-microbit-v2.hex) - -### DFRobot Maqueen Plus V2 {#dfrobot-maq-plus} - -![Photograph of the Maqueen plus](./images/dfrobotmaqueenplusv2.jpg){:class="photo"} - -- [Home](https://www.dfrobot.com/product-2026.html) -- [Download for micro:bit V1](https://microsoft.github.io/microbit-robot/assets/dfrobot-maqueen-plus-for-microbit-v1.hex) -- [Download for micro:bit V2](https://microsoft.github.io/microbit-robot/assets/dfrobot-maqueen-plus-for-microbit-v2.hex) - -### Elecfreaks Cutebot {#cutebot} - -![Photograph of the Cutebot](./images/cutebot.jpeg){:class="photo"} - -- [Home](https://www.elecfreaks.com/micro-bit-smart-cutebot.html) -- [Download for micro:bit V1](https://microsoft.github.io/microbit-robot/assets/elecfreaks-cutebot-for-microbit-v1.hex) -- [Download for micro:bit V2](https://microsoft.github.io/microbit-robot/assets/elecfreaks-cutebot-for-microbit-v2.hex) - -### Elecfreaks Cutebot PRO {#cutebot-pro} - -![Photograph of the Cutebot PRO](./images/cutebotpro.jpeg){:class="photo"} - -- [Home](https://shop.elecfreaks.com/products/elecfreaks-smart-cutebot-pro-v2-programming-robot-car-for-micro-bit) -- [Download for micro:bit V1](https://microsoft.github.io/microbit-robot/assets/elecfreaks-cutebotpro-for-microbit-v1.hex) -- [Download for micro:bit V2](https://microsoft.github.io/microbit-robot/assets/elecfreaks-cutebotpro-for-microbit-v2.hex) - -## Forward Education Smart Vehicle Kit {#forward-education-smart-vehicle-kit} - -![Photograph of car made with Smart Vehicle Kit](./images/fwdedu.jpg){:class="photo"} - -This car is made with Jacdac modules, so only works with micro:bit V2: - -- [Home](https://forwardedu.com/compare-kits/) -- [Download for micro:bit V2](https://microsoft.github.io/microbit-robot/assets/fwdedu-for-microbit-v2.hex) - -## InkSmith K8 {#inksmith-k8} - -![Photograph of the K8](./images/inksmithk8.webp){:class="photo"} - -- [Home](https://www.inksmith.ca/products/k8-robotics-kit) -- [Download for micro:bit V1](https://microsoft.github.io/microbit-robot/assets/inksmith-k8-for-microbit-v1.hex) -- [Download for micro:bit V2](https://microsoft.github.io/microbit-robot/assets/inksmith-k8-for-microbit-v2.hex) - -### KeyStudio KS0426 Mini Smart Robot {#keystudio-mini} - -- [Home](https://wiki.keyestudio.com/KS0426_Keyestudio_Micro%EF%BC%9Abit_Mini_Smart_Robot_Car_Kit_V2) -- [Download for micro:bit V1](https://microsoft.github.io/microbit-robot/assets/keystudio-minismartrobot-for-microbit-v1.hex) -- [Download for micro:bit V2](https://microsoft.github.io/microbit-robot/assets/keystudio-minismartrobot-for-microbit-v2.hex) - -### KittenBot MiniLFR {#kittenbot-mlfr} - -![Photo of the MiniLFR robot](./images/minilfr.png){:class="photo"} - -- [Home](https://www.kittenbot.cc/products/kittenbot-minilfr-programmable-robot-car-kit-for-microbit) -- [Download for micro:bit V1](https://microsoft.github.io/microbit-robot/assets/kittenbot-minilfr-for-microbit-v1.hex) -- [Download for micro:bit V2](https://microsoft.github.io/microbit-robot/assets/kittenbot-minilfr-for-microbit-v2.hex) - -### KittenBot Robotbit {#kittenbot-robotbit} - -![Photo of the Robotbit robot](./images/robotbit.webp){:class="photo"} - -- [Home](https://www.kittenbot.cc/products/robotbit-robotics-expansion-board-for-micro-bit) -- [Download for micro:bit V1](https://microsoft.github.io/microbit-robot/assets/kittenbot-robotbit-for-microbit-v1.hex) -- [Download for micro:bit V2](https://microsoft.github.io/microbit-robot/assets/kittenbot-robotbit-for-microbit-v2.hex) - -### KittenBot Nanobit {#kittenbot-nanobit} - -![Photo of the Nanobit robot](./images/nanobit.webp){:class="photo"} - -- [Home](https://www.kittenbot.cc/products/kittenbot-nanobit-with-kb-link-downloader-for-makecode-python-and-arduino-programming) -- [Download for micro:bit V1](https://microsoft.github.io/microbit-robot/assets/kittenbot-nanobit-for-microbit-v1.hex) -- [Download for micro:bit V2](https://microsoft.github.io/microbit-robot/assets/kittenbot-nanobit-for-microbit-v2.hex) - -### Yahboom Tiny:bit {#yahboom} - -![Photograph of the Tiny:bit](./images/tinybit.jpeg){:class="photo"} - -- [Home](http://www.yahboom.net/study/Tiny:bit) -- [Download for micro:bit V1](https://microsoft.github.io/microbit-robot/assets/yahboom-tinybit-for-microbit-v1.hex) -- [Download for micro:bit V2](https://microsoft.github.io/microbit-robot/assets/yahboom-tinybit-for-microbit-v2.hex) - -### Contributing {#contributing} - -The source of the robot firmware are at [https://github.com/microsoft/microcode/tree/main/robot](https://github.com/microsoft/microcode/tree/main/robot). We accept pull request to add new robots. - -### Hardware requirements - -The firmware is designed for popular rover robots found in the micro:bit ecosystem -(and more can be added): - -- 2 motors that can be forward, backward, left, right turns. Precise detection of distance is **not** needed. -- 2 or more line sensors -- a distance sensor, typically an ultrasonic sensor - -The following features are found often but are optional: - -- RGB LEDs -- Buzzer -- Programmable LED strip - -### How to prepare a pull request {#new-robot} - -To add a new robot to the list, prepare a pull request in [microsoft/microcode](https://github.com/microsoft/microcode) with: - -- a new class extending `Robot` and configuring the hardware (see other robots) -- a global field instance instantiating the robot (see other robots) -- a URL in the jsdocs of the class pointing to the robot homepage -- add `main{company}{productname}.ts` file that starts the robot -- add `pxt-{company}{productname}.json` file that overrides the test files to load `main{company}{productname}.ts` -- add call to `mkc pxt-{company}{productname}.json` in `.github/workflows/makecode.yml` -- add image under `docs/static/images` -- add section in `docs/robot-supported.md` with your robot picture, and Home URL. - -Make sure to test and tune the configuration options in the robot class for your particular -chassis/motor/line detectors. You may want to tweak some of the constants in the robot class to optimize the behavior of the robot. +MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/robots-supported](here) \ No newline at end of file diff --git a/docs/samples.md b/docs/samples.md index 0a415709..330994aa 100644 --- a/docs/samples.md +++ b/docs/samples.md @@ -4,85 +4,4 @@ image: ./docs/images/generated/sample_smiley_buttons.png description: Annotated example programs. --- -Annotated example programs. - -![Smiley Buttons MicroCode program](./images/generated/sample_smiley_buttons.png){:class="sample"} - -- [![new program](./images/generated/icon_new_program.png){:class="icon"} first program](./samples/first-program) - -## The basics - -- [![Flashing Heart icon](./images/generated/icon_sample_flashing_heart.png){:class="icon"} flashing heart](./samples/flashing-heart) -- [![Smiley Buttons icon](./images/generated/icon_sample_smiley_buttons.png){:class="icon"} smiley buttons](./samples/smiley-buttons) -- [![Pet hamster icon](./images/generated/icon_sample_pet_hamster.png){:class="icon"} pet hamster](./samples/pet-hamster) - -## Variables - -These sample use variables to store and read numeric values. - -### Dices - -These samples store a random number and use to build mini games. - -- [![Head or tail icon](./images/generated/icon_sample_head_or_tail.png){:class="icon"} head or tail](./samples/head-or-tail) -- [crooked head or tail](./samples/crooked-head-or-tail) - -- [![Rock Paper Scissors icon](./images/generated/icon_sample_rock_paper_scissors.png){:class="icon"} rock paper scissors](./samples/rock-paper-scissors) - -### Counters - -These sample use variables to build counters using buttons, movement or sounds: - -- [counter](./samples/counter) -- [step counter](./samples/step-counter) -- [clap counter](./samples/clap-counter) -- [random counter](./samples/random-counter) - -These counters are a bit more involved: - -- [times table](./samples/times-table) - -## Pages - -These sample use multiple pages in their programs: - -- [![Hot potato icon](./images/generated/icon_hot_potato.png){:class="icon"} hot potato](./samples/hot-potato) -- [![Clap lights icon](./images/generated/icon_sample_clap_lights.png){:class="icon"} clap lights](./samples/clap-lights) -- [![reaction time](./images/generated/icon_reaction_time.png){:class="icon"} reaction time](./samples/reaction-time) -- [double counter](./samples/double-counter) -- [battery charger prank](./samples/battery-charger-prank) -- [24 7 clap game](./samples/24-7-clap) - -## Radio - -These programs use radio to send messages between multiple -micro:bits. - -- [![Chuck a duck icon](./images/generated/icon_sample_chuck_a_duck.png){:class="icon"} chuck a duck](./samples/chuck-a-duck) -- [![Firefly icon](./images/generated/icon_sample_firefly.png){:class="icon"} firefly](./samples/firefly) -- [zombie detector](./samples/zombie-detector) -- [green light red light](./samples/green-light-red-light) - -## micro:bit Robot {#robot} - -These sample work with a [2 wheel robot controlled by a micro:bit](./robot). - -- [![robot commands](./images/generated/icon_CAR.png){:class="icon"}robot shake](./samples/robot-shake) -- [![robot avoid wall](./images/generated/icon_S13.png){:class="icon"} robot avoid wall](./samples/robot-avoid-wall) -- [![robot line detected](./images/generated/icon_S14.png){:class="icon"} robot follow line](./samples/robot-follow-line) - -## Jacdac modules {#jacdac} - -These samples use [Jacdac](https://aka.ms/jacdac) modules to extend the capabilities of the -micro:bit. The programming tiles for the modules appear in MicroCode when the modules are -plugged in (either via a Jacdaptor or the Kittenbot shield). All the modules from [Kittenbot Jacdac Kit A](https://microsoft.github.io/jacdac-docs/devices/kittenbot/jacdacstarterkitawithjacdaptorformicrobitv2v10/) and the [Forward Education Climate Kit](https://microsoft.github.io/jacdac-docs/devices/forward-education/climateactionkitv10/) are supported. - -- [![railroad crossing](./images/generated/icon_railroad_crossing.png){:class="icon"} railroad crossing](./samples/railroad-crossing) -- [inchworm robot](./samples/inchworm) -- [![measure light](./images/generated/icon_S5.png){:class="icon"} measure light](./samples/light-levels) -- [![detect magnet](./images/generated/icon_S10.png){:class="icon"} detect magnet](./samples/magnet-levels) -- [![slider](./images/generated/icon_S11.png){:class="icon"} slider](./samples/slider-levels) -- [![dial](./images/generated/icon_S12.png){:class="icon"} turn dial](./samples/count-turns) -- [![key demo](./images/generated/icon_F5.png){:class="icon"} key demo](./samples/key-demo) -- [![moisture sensor demo](./images/generated/icon_S16.png){:class="icon"} water plant](./samples/water-plant) -- [![distance sensor demo](./images/generated/icon_S17.png){:class="icon"} measure distance](./samples/distance-measure) +MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/samples](here) \ No newline at end of file From 6e4f0564aa89b6454c3283280ab70fae893b8837 Mon Sep 17 00:00:00 2001 From: Tom Ball Date: Thu, 3 Apr 2025 09:45:44 -0700 Subject: [PATCH 2/4] update readme --- README.md | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 2fb905cc..29abba7f 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,6 @@ -## Microsoft MicroCode [https://aka.ms/microcode](https://aka.ms/microcode) +## Microsoft MicroCode -Microsoft MicroCode is an icon-based programming language and editor for young learners to code with the [BBC micro:bit V2](https://microbit.org). MicroCode allows you to program the micro:bit V2 with only an [Arcade shield accessory](#arcade-shields-for-microbit-v2) - _no other computer is required!_ If you prefer the web browser, there's also a MicroCode web app that connects to your micro:bit V2 over WebUSB. - -Here's the classic micro:bit _Happy-A-button/Sad-B-button_ program in MicroCode: - -![Happy sad program in microcode](./docs/images/generated/sample_smiley_buttons.png) - -## Getting started - -- **Read the [MicroCode user guide](https://microsoft.github.io/microcode/docs/manual)** -- [try it now!](https://microsoft.github.io/microcode/) - -## [Arcade shields](https://microsoft.github.io/microcode/docs/manual#arcade-shield) for micro:bit V2 - -There are various [Arcade shields](https://microsoft.github.io/microcode/docs/manual#arcade-shield) available on the market today, as shown below. - - - -## Robot - -MicroCode can also be used to [program and control a 2 wheeled rover robot](https://microsoft.github.io/microcode/docs/robot). - -![robot line following](https://microsoft.github.io/microcode/docs/images/generated/sample_robot_line_follow.png){:class="sample"} - - - -## Development - -To contribute to MicroCode, please read about [MicroCode development](./docs/develop.md). +> NOTE: MicroCode has moved here [https://github.com/microbit-apps/microcode](here). ## Contributing From 5edb8c9eb84dd786b6349265ca298339e6b177a7 Mon Sep 17 00:00:00 2001 From: Tom Ball Date: Thu, 3 Apr 2025 09:57:55 -0700 Subject: [PATCH 3/4] Update docs/samples.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/samples.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/samples.md b/docs/samples.md index 330994aa..d3e0b2cc 100644 --- a/docs/samples.md +++ b/docs/samples.md @@ -4,4 +4,4 @@ image: ./docs/images/generated/sample_smiley_buttons.png description: Annotated example programs. --- -MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/samples](here) \ No newline at end of file +MicroCode has moved here [here](https://microbit-apps.github.io/microcode-classic/docs/samples) \ No newline at end of file From 2cfcbc7b204e049e8f47b65cbc53268fe05ff9c5 Mon Sep 17 00:00:00 2001 From: Tom Ball Date: Thu, 3 Apr 2025 10:01:50 -0700 Subject: [PATCH 4/4] full links --- README.md | 2 +- docs/develop.md | 2 +- docs/language.md | 2 +- docs/localization.md | 2 +- docs/manual.md | 2 +- docs/robot.md | 2 +- docs/robots-supported.md | 2 +- docs/samples.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 29abba7f..230cb664 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Microsoft MicroCode -> NOTE: MicroCode has moved here [https://github.com/microbit-apps/microcode](here). +> NOTE: MicroCode has moved to [https://github.com/microbit-apps/microcode](https://github.com/microbit-apps/microcode). ## Contributing diff --git a/docs/develop.md b/docs/develop.md index 5a91d99e..4b0248eb 100644 --- a/docs/develop.md +++ b/docs/develop.md @@ -3,4 +3,4 @@ title: Developer Docs image: ./docs/images/generated/sample_smiley_buttons.png --- -MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/develop](here) \ No newline at end of file +MicroCode has moved to [https://microbit-apps.github.io/microcode-classic/docs/develop](https://microbit-apps.github.io/microcode-classic/docs/develop) \ No newline at end of file diff --git a/docs/language.md b/docs/language.md index 9d125343..8b9e4c7d 100644 --- a/docs/language.md +++ b/docs/language.md @@ -4,4 +4,4 @@ image: ./docs/images/generated/sample_smiley_buttons.png description: Documentation of the MicroCode programming language. --- -MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/language](here) \ No newline at end of file +MicroCode has moved to [https://microbit-apps.github.io/microcode-classic/docs/language](https://microbit-apps.github.io/microcode-classic/docs/language) \ No newline at end of file diff --git a/docs/localization.md b/docs/localization.md index 22845520..38b70079 100644 --- a/docs/localization.md +++ b/docs/localization.md @@ -4,4 +4,4 @@ image: ./docs/images/localization.png description: Instruction to help localize MicroCode --- -MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/localization](here) \ No newline at end of file +MicroCode has moved to [https://microbit-apps.github.io/microcode-classic/docs/localization](https://microbit-apps.github.io/microcode-classic/docs/localization) \ No newline at end of file diff --git a/docs/manual.md b/docs/manual.md index 079836c4..29506dfb 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -4,4 +4,4 @@ image: ./docs/images/generated/sample_smiley_buttons.png description: User guide for the MicroCode editor --- -MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/manual](here) \ No newline at end of file +MicroCode has moved to [https://microbit-apps.github.io/microcode-classic/docs/manual](https://microbit-apps.github.io/microcode-classic/docs/manual) \ No newline at end of file diff --git a/docs/robot.md b/docs/robot.md index 7cd64b49..bc32e73a 100644 --- a/docs/robot.md +++ b/docs/robot.md @@ -2,4 +2,4 @@ ![Photograph of micro:bit robots](./images/robots.jpg) -MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/robot](here) \ No newline at end of file +MicroCode has moved to [https://microbit-apps.github.io/microcode-classic/docs/robot](https://microbit-apps.github.io/microcode-classic/docs/robot) \ No newline at end of file diff --git a/docs/robots-supported.md b/docs/robots-supported.md index 0a1e7469..86c5442c 100644 --- a/docs/robots-supported.md +++ b/docs/robots-supported.md @@ -1,3 +1,3 @@ ## Supported robots -MicroCode has moved here [https://microbit-apps.github.io/microcode-classic/docs/robots-supported](here) \ No newline at end of file +MicroCode has moved to [https://microbit-apps.github.io/microcode-classic/docs/robots-supported](https://microbit-apps.github.io/microcode-classic/docs/robots-supported) \ No newline at end of file diff --git a/docs/samples.md b/docs/samples.md index d3e0b2cc..281c97c0 100644 --- a/docs/samples.md +++ b/docs/samples.md @@ -4,4 +4,4 @@ image: ./docs/images/generated/sample_smiley_buttons.png description: Annotated example programs. --- -MicroCode has moved here [here](https://microbit-apps.github.io/microcode-classic/docs/samples) \ No newline at end of file +MicroCode has moved to [https://microbit-apps.github.io/microcode-classic/docs/samples](https://microbit-apps.github.io/microcode-classic/docs/samples)