Compare commits

...

175 Commits

Author SHA1 Message Date
89ceeefc32 0.5.52 2016-10-30 22:23:02 -07:00
91235d2377 Bump pxt-core to 0.5.29 2016-10-30 22:23:00 -07:00
a805d7b8a8 updated ref version 2016-10-28 16:44:22 -07:00
89fdbcdc4f 0.5.51 2016-10-28 16:14:51 -07:00
92d1d2ffc3 Merge branch 'master' of https://github.com/Microsoft/pxt-calliope 2016-10-28 14:08:22 -07:00
82c9af836f bumped to 0.5.50 2016-10-28 14:08:14 -07:00
da90401fe6 0.5.50 2016-10-28 14:05:33 -07:00
315a12dd8b Bump pxt-core to 0.5.28 2016-10-28 14:05:32 -07:00
72ec2d617e 0.5.49 2016-10-28 13:53:46 -07:00
4d9ae63831 Bump pxt-core to 0.5.27 2016-10-28 13:53:41 -07:00
3eab21cff1 udpated icons 2016-10-28 13:52:17 -07:00
5a37385d14 0.5.48 2016-10-28 13:31:48 -07:00
9fa412ff6f Bump pxt-core to 0.5.26 2016-10-28 13:31:43 -07:00
3f7fbb70ba Removing blockly trash icon 2016-10-28 11:27:26 -07:00
20189a709b Using Google font: Roboto 2016-10-28 11:15:19 -07:00
111b321722 0.5.47 2016-10-28 10:41:47 -07:00
b8fe8f9294 Bump pxt-core to 0.5.24 2016-10-28 10:41:45 -07:00
7b478c4c38 update ref version 2016-10-28 17:47:48 +02:00
a68e1a611d 0.5.46 2016-10-28 17:47:33 +02:00
b3b2944b46 add dnd picture 2016-10-28 17:39:57 +02:00
c809ee4fdf 0.5.45 2016-10-28 00:36:26 -07:00
8e67e69602 Bump pxt-core to 0.5.23 2016-10-28 00:36:23 -07:00
0b508e37b1 0.5.44 2016-10-27 23:21:21 -07:00
e1a3aca9f8 Removing blockly custom media folder 2016-10-27 23:21:05 -07:00
bbe93ae9a2 UI changes: fixing mobile view. 2016-10-27 18:43:09 -07:00
6fd18b4f4c 0.5.43 2016-10-27 16:20:39 -07:00
b511537348 Bump pxt-core to 0.5.21 2016-10-27 16:20:37 -07:00
749ba6b984 UI changes to match the calliope design. 2016-10-27 16:15:44 -07:00
e571bec213 0.5.42 2016-10-27 14:30:07 -07:00
1ad90eda81 Bump pxt-core to 0.5.18 2016-10-27 14:30:05 -07:00
0c604498d3 0.5.41 2016-10-27 13:48:27 -07:00
a8ec408f96 Merge branch 'master' of https://github.com/Microsoft/pxt-calliope 2016-10-27 13:47:58 -07:00
40fe1b4616 fix simulator support for music 2016-10-27 13:47:39 -07:00
e52da19925 0.5.40 2016-10-27 20:50:10 +02:00
d558f70118 add first pictures of calliope 2016-10-27 20:47:09 +02:00
8fca50e907 0.5.39 2016-10-27 11:31:10 -07:00
8c4abe979b Bump pxt-core to 0.5.17 2016-10-27 11:31:08 -07:00
d4fa9dab1b 0.5.38 2016-10-27 19:49:35 +02:00
955b67b6b8 rev. 0.2 sound patches 2016-10-27 19:48:42 +02:00
739be09ac9 Bumping main version to 0.5.37 with fixed icons 2016-10-25 19:53:38 +01:00
5877adc595 0.5.37 2016-10-25 18:55:41 +01:00
0380f4f0d0 Bump pxt-core to 0.5.11 2016-10-25 18:55:40 +01:00
13a4b03e9a 0.5.36 2016-10-24 23:18:56 -07:00
4b21d51769 Bump pxt-core to 0.5.9 2016-10-24 23:18:52 -07:00
e7aed1d162 fixed sounds in simulator 2016-10-24 23:17:16 -07:00
60e71e3e35 0.5.35 2016-10-24 16:39:57 -07:00
b003d89061 Bump pxt-core to 0.5.7 2016-10-24 16:39:55 -07:00
a5eb93d3e1 Updating theme.config to use the pxt theme. 2016-10-24 14:07:20 -07:00
224cb446e4 0.5.34 2016-10-24 13:51:08 -07:00
62b3d7504f Bump pxt-core to 0.5.4 2016-10-24 13:51:06 -07:00
c937cba17e merging pxt-microbit updates 2016-10-24 13:00:39 -07:00
79c89b832a New Radio API (#287)
* Adding radio API for receiving a packet

* More new radio API changes

* renaming some properties

* Redoing radio packet parsing and updating new callback api
2016-10-24 12:55:44 -07:00
0765159633 0.5.33 2016-10-24 20:53:32 +01:00
b14a025b14 Bump pxt-core to 0.5.3 2016-10-24 20:53:32 +01:00
3ccc8b7db3 0.5.3 2016-10-24 12:52:33 -07:00
7c8bae3cf0 0.5.2 2016-10-24 20:51:33 +01:00
000f784011 Bump pxt-core to 0.5.3 2016-10-24 20:51:33 +01:00
d85446d34d Support for offline hex cache (#282) 2016-10-24 12:32:05 -07:00
74f8cc7b2e 0.5.32 2016-10-24 10:28:24 -07:00
cf778686c3 Merging microbit/master 2016-10-24 10:27:48 -07:00
99bee9e796 Merge branch 'master' of https://github.com/Microsoft/pxt-calliope 2016-10-24 10:14:43 -07:00
cb61c1a712 Bump main version to 0.5.31 with fixed icons 2016-10-24 18:01:45 +01:00
fdf3d1b66c 0.5.31 2016-10-24 17:39:33 +01:00
25ddbf9ffd Bump pxt-core to 0.5.2 2016-10-24 17:39:32 +01:00
578f971d26 Add tagged release names 2016-10-24 16:59:46 +01:00
06641d4e5c Beta is latest tagged releases 2016-10-24 16:58:12 +01:00
a705c4882b Add initial release pointers 2016-10-24 16:48:03 +01:00
b36ffaf29c 0.5.30 2016-10-24 16:32:56 +01:00
bff088fced Bump pxt-core to 0.5.1 2016-10-24 16:32:56 +01:00
784565b24e 0.5.1 2016-10-24 16:31:48 +01:00
b59e4effff Bump pxt-core to 0.5.1 2016-10-24 16:31:48 +01:00
2db2741b08 Bumping to 0.5 (to ~sync with pxt) 2016-10-24 16:30:56 +01:00
66a46e4046 fixing links in docs 2016-10-22 23:04:08 -07:00
2f11d603e7 Added a range of original TouchDevelop scripts converted to .ts for tests (#283) 2016-10-22 21:32:57 -07:00
8089fe262e 0.4.64 2016-10-22 21:29:43 -07:00
7d7d13f3ab Bump pxt-core to 0.4.74 2016-10-22 21:29:41 -07:00
bd1536132d fixing references / snippets
cleanup "snippets" compilation state
2016-10-22 21:29:31 -07:00
fcefe1ed36 Fixing a few typos 2016-10-22 20:34:18 -07:00
748581d76d 0.4.63 2016-10-22 20:31:17 -07:00
f21f9e6e88 Bump pxt-core to 0.4.73 2016-10-22 20:31:15 -07:00
3f1817037e Added a new project, the magic button trick (#284)
* adding the 'magic button trick' project

* tweaking text and fixing spelling mistakes

* adding vscode temp files to gitignore

* updated after feedback

* removing vscode temp files

* missed two vars

* deleting vscode temp file
2016-10-22 19:53:48 -07:00
4bcba9b9e5 0.4.62 2016-10-21 14:51:39 -07:00
b3b836d77c Bump pxt-core to 0.4.72 2016-10-21 14:50:55 -07:00
a2cb2c2ed0 Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2016-10-21 14:46:23 -07:00
44e2ffc874 Merge pull request #281 from Microsoft/musicfix
Fixing music doc issues
2016-10-21 14:21:19 -07:00
64b68c7439 updated faq to point to support 2016-10-21 11:45:29 -07:00
198b24c6a4 use secure support link 2016-10-21 11:42:29 -07:00
a90a43d719 updated logo 2016-10-21 11:12:03 -07:00
f9d138cb42 migrating to pxt.microbit.org settings 2016-10-21 10:49:04 -07:00
f2c87db3ed using default analytics settings 2016-10-21 10:23:23 -07:00
13089f92a8 using default tracking settings 2016-10-21 09:56:28 -07:00
0b1b312e76 Fixing music doc issues 2016-10-21 08:48:43 -07:00
958ff2ef40 0.4.61 2016-10-20 22:45:57 -07:00
eaf982903f Bump pxt-core to 0.4.71 2016-10-20 22:45:50 -07:00
8c15af11db 0.5.29 2016-10-20 20:16:52 -07:00
35e414764f missing tools 2016-10-20 20:14:25 -07:00
333659c320 0.5.28 2016-10-20 20:12:03 -07:00
8c161583eb Bump pxt-core to 0.4.71 2016-10-20 20:12:02 -07:00
b20e185bf2 parameterize download button color 2016-10-20 19:36:00 -07:00
299b595581 added custom theme style 2016-10-20 19:29:10 -07:00
65433216e6 adding semantic ui files 2016-10-20 16:40:39 -07:00
cbfbcd080a 0.4.60 2016-10-20 15:09:13 -07:00
9c389e290e Bump pxt-core to 0.4.70 2016-10-20 15:09:11 -07:00
4dd26f854c 0.4.59 2016-10-20 12:18:39 -07:00
66444b886c Bump pxt-core to 0.4.69 2016-10-20 12:18:37 -07:00
9ea2081e89 0.5.27 2016-10-20 11:48:48 -07:00
808e5fa17b Bump pxt-core to 0.4.68 2016-10-20 11:48:46 -07:00
20d967a230 removing .ico file 2016-10-20 11:30:04 -07:00
c1e5419e45 updated icons 2016-10-20 11:26:44 -07:00
0c01fdb30b adding favicon configuration file 2016-10-20 11:09:34 -07:00
75c2ccdea9 0.4.58 2016-10-20 10:12:33 -07:00
2dff5c1140 Bump pxt-core to 0.4.68 2016-10-20 10:12:31 -07:00
0ab28076f3 removing windows 10 client, updated urls in chrome/macos/uploaders 2016-10-20 10:01:02 -07:00
27f5411404 0.5.26 2016-10-20 08:29:16 -07:00
f53eab0539 Bump pxt-core to 0.4.67 2016-10-20 08:29:11 -07:00
8030f27fb7 0.4.57 2016-10-19 22:47:10 -07:00
33c4b2b9b7 Bump pxt-core to 0.4.67 2016-10-19 22:47:07 -07:00
2463faf8d6 updated tracking info 2016-10-19 22:46:44 -07:00
6db78761c4 0.4.56 2016-10-19 16:53:30 -07:00
a0893cdaff Bump pxt-core to 0.4.66 2016-10-19 16:53:25 -07:00
c6fa997f02 updated docs from codethemicrobit to pxt.microbit.org 2016-10-19 16:49:05 -07:00
76d236e4d9 updated loc files 2016-10-19 10:45:39 -07:00
445fe12629 0.5.25 2016-10-19 19:11:13 +02:00
ddd6e90c6d Merge remote-tracking branch 'origin/master' 2016-10-19 19:08:52 +02:00
fd14ba6ff1 fix touch pins, add test for buttons and pins, update dependency 2016-10-19 19:08:41 +02:00
28a8f21d40 merging ble changes 2016-10-18 21:55:02 -07:00
0f7323f2da 0.4.55 2016-10-18 21:52:38 -07:00
23d30484d4 updated docs page 2016-10-18 21:52:10 -07:00
6ad59e04a6 fixed uart issues 2016-10-18 21:47:54 -07:00
ae5d5c74a7 better support for BLE UART and alignment with serial blocks. (#276)
* aligning uart apis with serial

* reorganizing serial/bluetooth blocks

* Autoupdate configuration for UART. (#279)

* Autoupdate configuration for UART.

* removing serial autoupdates.
2016-10-18 21:36:42 -07:00
3f626105cd 0.5.24 2016-10-18 21:07:02 -07:00
d9ff9c4800 Bump pxt-core to 0.4.65 2016-10-18 21:07:00 -07:00
75baca4a97 0.4.54 2016-10-18 21:03:36 -07:00
58ae4945cb Bump pxt-core to 0.4.65 2016-10-18 21:03:34 -07:00
fba37d96b2 updated localization help 2016-10-18 13:19:46 -07:00
31998fec05 0.5.23 2016-10-18 13:18:45 -07:00
342aa3ca32 Bump pxt-core to 0.4.63 2016-10-18 13:18:43 -07:00
5eb8704382 0.4.53 2016-10-18 13:18:20 -07:00
81b66664ef Bump pxt-core to 0.4.63 2016-10-18 13:18:19 -07:00
135aaf4855 0.4.52 2016-10-18 09:08:25 -07:00
9b599b6242 0.5.22 2016-10-18 16:56:58 +02:00
e5e63c548f update dal defines 2016-10-18 16:56:42 +02:00
f3eb9a988f update dependencies 2016-10-18 16:56:15 +02:00
e7e2ff7752 gesture updates 2016-10-18 16:40:53 +02:00
f10ac93268 add handling of gestures (we only have 2g, 6g ... no 3g), add mac/idea ignored files 2016-10-18 15:44:49 +02:00
47f46553e0 fix name of board 2016-10-18 15:43:52 +02:00
3158e95cde 0.5.21 2016-10-17 21:39:08 -07:00
854029fe33 updated board name 2016-10-17 21:38:58 -07:00
1b379bddd0 0.5.20 2016-10-17 21:35:07 -07:00
9495da9a53 0.5.19 2016-10-17 21:25:11 -07:00
128b3f2f51 Bump pxt-core to 0.4.62 2016-10-17 21:25:08 -07:00
1fbf257619 0.4.51 2016-10-17 21:12:33 -07:00
932c01f394 Bump pxt-core to 0.4.62 2016-10-17 21:12:30 -07:00
c3b2b99d7c 0.4.50 2016-10-17 16:45:20 -07:00
ec910cb10f Bump pxt-core to 0.4.60 2016-10-17 16:45:17 -07:00
a19d1c848b renaming board name 2016-10-17 16:18:04 -07:00
a331a017b8 merged microbit changes 2016-10-17 13:36:54 -07:00
790b9f557a renaming translation files 2016-10-17 13:33:27 -07:00
0b469f69b6 Fix i18n not working after 277d5a7 (#277)
* Fix i18n not working after 277d5a7

The translation strings file in "core" package should have file names
"core-strings.json" or "core-jsdoc-strings.json".

* Enable ja translation

Rename "core-strings.json" to "core-jsdoc-strings.json".
Add new "core-strings.json" as a copy of the template.
Add two lines for the files in "pxt.json".
2016-10-17 11:13:38 -07:00
5cce86ec7e 0.5.18 2016-10-17 10:54:19 -07:00
65e01dc0df Bump pxt-core to 0.4.59 2016-10-17 10:54:17 -07:00
1a3c31c9f3 Deploy no longer throws when no drives found (#269)
pxt deploy no longer throws when no drives found
2016-10-17 07:39:29 -07:00
5d4bd77bf4 0.4.49 2016-10-14 22:57:42 -07:00
c83d7e9f07 Bump pxt-core to 0.4.58 2016-10-14 22:57:35 -07:00
efee05c7f5 0.4.48 2016-10-14 11:30:47 -07:00
cc9ab86181 Bump pxt-core to 0.4.57 2016-10-14 11:30:41 -07:00
ef8d7185ee adding lessons to create circuit using aluminium foil 2016-10-13 12:52:47 -07:00
b0392da8b1 Fix indentation of showLeds in a couple of projects. 2016-10-13 11:32:25 -07:00
c817f9e3ff re-enabling sharing after bug in share-editor has been fixed. 2016-10-13 10:55:52 -07:00
5f78f98f94 0.4.47 2016-10-12 23:52:11 -07:00
395b6184b9 Bump pxt-core to 0.4.55 2016-10-12 23:52:09 -07:00
3274964a11 0.4.46 2016-10-12 04:49:42 -07:00
f5e8b35df4 Bump pxt-core to 0.4.54 2016-10-12 04:49:40 -07:00
996073728c 0.4.45 2016-10-12 04:02:55 -07:00
1e964ba1ea Bump pxt-core to 0.4.53 2016-10-12 04:02:53 -07:00
358 changed files with 5862 additions and 1022 deletions

7
.gitignore vendored
View File

@ -16,6 +16,7 @@ clients/win10/*.opendb
clients/**/bin/** clients/**/bin/**
clients/**/obj/** clients/**/obj/**
clients/electron/projects clients/electron/projects
hexcache
*.user *.user
*.sw? *.sw?
@ -24,3 +25,9 @@ clients/electron/projects
*.db *.db
*.suo *.suo
*.log *.log
.DS_Store
.idea
*.iml
.vscode/.BROWSE.VC.DB-shm
.vscode/.BROWSE.VC.DB-wal

View File

@ -61,7 +61,7 @@ function findNewDevices() {
function main() { function main() {
// Register new clients in the [ports] global variable. // Register new clients in the [ports] global variable.
chrome.runtime.onConnectExternal.addListener(function (port) { chrome.runtime.onConnectExternal.addListener(function (port) {
if (/^(micro:bit|touchdevelop|yelm|pxt|codemicrobit|codethemicrobit)$/.test(port.name)) { if (/^(micro:bit|touchdevelop|yelm|pxt|codemicrobit|codethemicrobit|pxt.microbit.org)$/.test(port.name)) {
ports.push(port); ports.push(port);
port.onDisconnect.addListener(function () { port.onDisconnect.addListener(function () {
ports = ports.filter(function (x) { return x != port }); ports = ports.filter(function (x) { return x != port });

View File

@ -11,8 +11,8 @@
"author": "Microsoft Corporation", "author": "Microsoft Corporation",
"short_name": "code the micro:bit", "short_name": "code the micro:bit",
"description": "Extension for https://codethemicrobit.com.", "description": "Extension for https://pxt.microbit.org.",
"homepage_url": "https://codethemicrobit.com", "homepage_url": "https://pxt.microbit.org",
"offline_enabled": "true", "offline_enabled": "true",
"icons": { "icons": {
"48": "logo48.png", "48": "logo48.png",
@ -25,6 +25,6 @@
], ],
"externally_connectable": { "externally_connectable": {
"matches": [ "*://localhost/*", "https://codethemicrobit.com/*", "https://*.codethemicrobit.com/*" ] "matches": [ "*://localhost/*", "https://pxt.microbit.org/*", "https://*.microbit.org/*" ]
} }
} }

View File

@ -124,7 +124,7 @@
} }
- (void)launchEditor:(id)sender { - (void)launchEditor:(id)sender {
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://codethemicrobit.com/"]]; [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://pxt.microbit.org/"]];
} }
@end @end

View File

@ -3,10 +3,10 @@
![](Microbit Uploader/Assets.xcassets/AppIcon.appiconset/icon_256x256.png) ![](Microbit Uploader/Assets.xcassets/AppIcon.appiconset/icon_256x256.png)
This project is a clone of the [Windows This project is a clone of the [Windows
uploader](https://codethemicrobit.com/uploader), but for OS X. Once launched, uploader](https://pxt.microbit.org/uploader), but for OS X. Once launched,
the app runs in your menu bar and will automatically deploy any HEX files to the app runs in your menu bar and will automatically deploy any HEX files to
your `micro:bit`. Like the Windows version, it is compatible with any browser your `micro:bit`. Like the Windows version, it is compatible with any browser
that can run [codethemicrobit.com](http://codethemicrobit.com). that can run [pxt.microbit.org](http://pxt.microbit.org).
## Install the built version ## Install the built version

View File

@ -1,48 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "m.pxt.io", "app\m.pxt.io.jsproj", "{39122940-AB16-4CD4-A0CE-79A3EB863ECF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.ActiveCfg = Debug|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.Build.0 = Debug|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.Deploy.0 = Debug|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.ActiveCfg = Debug|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.Build.0 = Debug|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.Deploy.0 = Debug|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.ActiveCfg = Debug|x86
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.Build.0 = Debug|x86
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.Deploy.0 = Debug|x86
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.Build.0 = Release|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.Deploy.0 = Release|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.ActiveCfg = Release|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.Build.0 = Release|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.Deploy.0 = Release|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.ActiveCfg = Release|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.Build.0 = Release|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.Deploy.0 = Release|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.ActiveCfg = Release|x86
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.Build.0 = Release|x86
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1 +0,0 @@
MainPackage=C:\gh\pxt-microbit\win10\app\bin\Debug\m.pxt.io_0.1.4.0_AnyCPU_Debug.appx

View File

@ -1,85 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>39122940-ab16-4cd4-a0ce-79a3eb863ecf</ProjectGuid>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0'">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" />
<PropertyGroup>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>$(VersionNumberMajor).$(VersionNumberMinor)</MinimumVisualStudioVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<PackageCertificateKeyFile>pxtwinapp_TemporaryKey.pfx</PackageCertificateKeyFile>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>neutral</AppxBundlePlatforms>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<Content Include="msapp-error.js" />
<Content Include="msapp-error.css" />
<Content Include="msapp-error.html" />
<Content Include="images\LockScreenLogo.scale-200.png" />
<Content Include="images\SplashScreen.scale-200.png" />
<Content Include="images\Square150x150Logo.scale-200.png" />
<Content Include="images\Square44x44Logo.scale-200.png" />
<Content Include="images\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="images\StoreLogo.png" />
<Content Include="images\Wide310x150Logo.scale-200.png" />
<None Include="pxtwinapp_TemporaryKey.pfx" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
<!-- To modify your build process, add your task inside one of the targets below then uncomment
that target and the DisableFastUpToDateCheck PropertyGroup.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<PropertyGroup>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
-->
</Project>

View File

@ -1,48 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "codethemicrobitapp", "codethemicrobitapp.jsproj", "{39122940-AB16-4CD4-A0CE-79A3EB863ECF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.ActiveCfg = Debug|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.Build.0 = Debug|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|ARM.Deploy.0 = Debug|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.ActiveCfg = Debug|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.Build.0 = Debug|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x64.Deploy.0 = Debug|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.ActiveCfg = Debug|x86
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.Build.0 = Debug|x86
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Debug|x86.Deploy.0 = Debug|x86
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.Build.0 = Release|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|Any CPU.Deploy.0 = Release|Any CPU
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.ActiveCfg = Release|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.Build.0 = Release|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|ARM.Deploy.0 = Release|ARM
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.ActiveCfg = Release|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.Build.0 = Release|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x64.Deploy.0 = Release|x64
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.ActiveCfg = Release|x86
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.Build.0 = Release|x86
{39122940-AB16-4CD4-A0CE-79A3EB863ECF}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -1,17 +0,0 @@
body {
margin: 10px;
}
.tip {
font-size: 90%;
padding-left: 20px;
}
.paramName {
font-size: 100%;
color: black;
}
.paramValue {
color: black;
}

View File

@ -1,26 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Navigation Error</title>
<link href="msapp-error.css" rel="stylesheet" type="text/css"/>
<script src="msapp-error.js" type="text/javascript"></script>
</head>
<body>
<h1>Navigation Error</h1>
<div id="failureUrl" class="param">
<span>-</span><span class="paramName">failureUrl</span><span>=</span>
<span id="failureUrlValue" class="paramValue"></span>
<span class="tip">(indicates the url where the error occurred)</span><br/>
</div><br/>
<div id="httpStatus" class="param">
<span>-</span><span class="paramName">httpStatus</span><span>=</span>
<span id="httpStatusValue" class="paramValue"></span>
<span class="tip">(available when the error has an http status code)</span><br/>
</div><br/>
<div id="failureName">
<span>-</span><span class="paramName">failureName</span><span>=</span>
<span id="failureNameValue" class="paramValue"></span>
<span class="tip">(available only when the error does not have a http status code)</span><br/>
</div>
</body>
</html>

View File

@ -1,22 +0,0 @@
(function () {
var validParameterNames = [ "httpStatus", "failureName", "failureUrl" ];
function parseQueryParameters() {
var query = location.search.slice(1);
return query.split("&").reduce(function (queryParameters, rawPair) {
var pair = rawPair.split("=").map(decodeURIComponent);
queryParameters[pair[0]] = pair[1];
return queryParameters;
}, {});
}
function initialize() {
var queryParameters = parseQueryParameters();
validParameterNames.forEach(function (parameterName) {
var parameterValue = queryParameters[parameterName] || "N/A";
document.getElementById(parameterName + "Value").textContent = parameterValue;
});
}
document.addEventListener("DOMContentLoaded", initialize);
}());

View File

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="39122940-ab16-4cd4-a0ce-79a3eb863ecf" Version="0.1.5.0" Publisher="CN=jhalleux" />
<mp:PhoneIdentity PhoneProductId="39122940-ab16-4cd4-a0ce-79a3eb863ecf" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>codethemicrobit</DisplayName>
<PublisherDisplayName>Microsoft</PublisherDisplayName>
<Logo>images\storelogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" StartPage="https://codethemicrobit.com">
<uap:ApplicationContentUriRules>
<uap:Rule Match="https://m.pxt.io/" Type="include" WindowsRuntimeAccess="all" />
<uap:Rule Match="https://codemicrobit.com/" Type="include" WindowsRuntimeAccess="all" />
<uap:Rule Match="https://codethemicrobit.com/" Type="include" WindowsRuntimeAccess="all" />
</uap:ApplicationContentUriRules>
<uap:VisualElements DisplayName="code the micro:bit" Description="A code editor for the BBC micro:bit with Blocks or Javascript." BackgroundColor="white" Square150x150Logo="images\Square150x150Logo.png" Square44x44Logo="images\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="images\Wide310x150Logo.png" ShortName="code the micro:bit">
</uap:DefaultTile>
<uap:SplashScreen Image="images\splashscreen.png" />
</uap:VisualElements>
<Extensions>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="microbithex">
<uap:DisplayName>BBC micro:bit binary file</uap:DisplayName>
<uap:SupportedFileTypes>
<uap:FileType ContentType="application/x-microbit-hex">.hex</uap:FileType>
</uap:SupportedFileTypes>
</uap:FileTypeAssociation>
</uap:Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<uap:Capability Name="removableStorage" />
<DeviceCapability Name="bluetooth" />
<DeviceCapability Name="serialcommunication">
<Device Id="any">
<Function Type="name:serialPort" />
</Device>
</DeviceCapability>
</Capabilities>
</Package>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

View File

@ -32,7 +32,7 @@ namespace Microsoft.MicroBit
private void openEditor() private void openEditor()
{ {
// lanch editor // lanch editor
try { Process.Start("https://codethemicrobit.com#uploader"); } catch (Exception) { } try { Process.Start("https://pxt.microbit.org#uploader"); } catch (Exception) { }
} }
private void initializeFileWatch() private void initializeFileWatch()
@ -236,7 +236,7 @@ namespace Microsoft.MicroBit
{ {
try try
{ {
Process.Start("https://codethemicrobit.com/uploader"); Process.Start("https://pxt.microbit.org/uploader");
} }
catch (IOException) { } catch (IOException) { }
} }

View File

@ -13,20 +13,20 @@ export function deployCoreAsync(res: ts.pxtc.CompileResult) {
return getBitDrivesAsync() return getBitDrivesAsync()
.then(drives => { .then(drives => {
if (drives.length == 0) { if (drives.length == 0) {
let msg = "cannot find any drives to deploy to"; console.log("cannot find any drives to deploy to");
console.log(msg); return Promise.resolve(0);
return Promise.reject(new Error(msg));
} }
console.log(`copy ${ts.pxtc.BINARY_HEX} to ` + drives.join(", ")) console.log(`copy ${ts.pxtc.BINARY_HEX} to ` + drives.join(", "));
return Promise.map(drives, d => let writeHexFile = (filename: string) => {
writeFileAsync(d + ts.pxtc.BINARY_HEX, res.outfiles[ts.pxtc.BINARY_HEX]) return writeFileAsync(filename + ts.pxtc.BINARY_HEX, res.outfiles[ts.pxtc.BINARY_HEX])
.then(() => { .then(() => console.log("wrote hex file to " + filename));
console.log("wrote hex file to " + d) };
}))
}) return Promise.map(drives, d => writeHexFile(d))
.then(() => { }) .then(() => drives.length);
});
} }
function getBitDrivesAsync(): Promise<string[]> { function getBitDrivesAsync(): Promise<string[]> {

View File

@ -1,6 +0,0 @@
<script type="text/javascript">
(function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=e.createElement("script");a.type="text/javascript";a.async=!0;a.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f)}})(document,window.mixpanel||[]);
mixpanel.init("762fef19c053a0ea4cec43d2fecae76e", { disable_persistence: true });
if (typeof pxtConfig !== "undefined") mixpanel.register({ target: pxtConfig.targetId, version: pxtConfig.targetVersion });
</script>

View File

@ -1,6 +0,0 @@
<script type="text/javascript">
(function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=e.createElement("script");a.type="text/javascript";a.async=!0;a.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f)}})(document,window.mixpanel||[]);
mixpanel.init("762fef19c053a0ea4cec43d2fecae76e", { disable_persistence: true });
if (typeof pxtConfig !== "undefined") mixpanel.register({ target: pxtConfig.targetId, version: pxtConfig.targetVersion });
</script>

View File

@ -79,7 +79,7 @@ When code is compiled to ARM machine code, the calls to JavaScript micro:bit fun
## [Command Line Tools](/cli) ## [Command Line Tools](/cli)
Looking to use codethemicrobit.com in your favorite editor? Install the [command line tools](/cli) and get rolling! Looking to use pxt.microbit.org in your favorite editor? Install the [command line tools](/cli) and get rolling!
## [Packages](/packages) ## [Packages](/packages)

3
docs/beta-ref.json Normal file
View File

@ -0,0 +1,3 @@
{
"appref": "v"
}

View File

@ -1,6 +1,6 @@
# Unsupported configuration # Unsupported configuration
[codethemicrobit.com](https://codethemicrobit.com) doesn't currently support [pxt.microbit.org](https://pxt.microbit.org) doesn't currently support
your browser or operating system. The following configurations are supported: your browser or operating system. The following configurations are supported:
## Windows ## Windows

View File

@ -1,12 +1,12 @@
# Technical information about browser support # Technical information about browser support
[codethemicrobit.com][] requires that you use a recent version of a modern [pxt.microbit.org][] requires that you use a recent version of a modern
browser, such as Microsoft Edge, Google Chrome, Mozilla Firefox, Safari, Opera, browser, such as Microsoft Edge, Google Chrome, Mozilla Firefox, Safari, Opera,
or IE11. This is because the editor uses modern web technologies such as [web or IE11. This is because the editor uses modern web technologies such as [web
workers][] to enable compiling [TypeScript][] in the browser, or the using the workers][] to enable compiling [TypeScript][] in the browser, or the using the
same [Monaco][] editor that powers [Visual Studio Code][]. same [Monaco][] editor that powers [Visual Studio Code][].
[codethemicrobit.com]: https://codethemicrobit.com [pxt.microbit.org]: https://pxt.microbit.org
[web workers]: http://www.w3.org/TR/workers/ [web workers]: http://www.w3.org/TR/workers/
[typescript]: http://www.typescriptlang.org [typescript]: http://www.typescriptlang.org
[monaco]: https://microsoft.github.io/monaco-editor/ [monaco]: https://microsoft.github.io/monaco-editor/

View File

@ -6,7 +6,7 @@ basic.forever(() => {
}) })
``` ```
It is possible to use the codethemicrobit tools from a command line interface (CLI). The PXT CLI allows to It is possible to use the tools from a command line interface (CLI). The PXT CLI allows to
* edit, compile or deploy JavaScript programs * edit, compile or deploy JavaScript programs
* can easily be integrated in most IDEs. It comes with built-in support for [Visual Studio Code](/code)! * can easily be integrated in most IDEs. It comes with built-in support for [Visual Studio Code](/code)!
* run a local web server for the web editor * run a local web server for the web editor

View File

@ -1,11 +1,40 @@
# crocodile clips # crocodile clips
The large holes at the bottom of the board are designed to attach alligator/crocodile clips. The large holes at the bottom of the board are designed to attach alligator/crocodile clips
Register an event that will execute whenever the user attaches one side of the crocodile clip to the `GND` pin, then connects and disconnects the unattached side of the crocodile clip to pin `0`, `1`, or `2`. to create electrical circuit with other components.
### Example: on pin pressed with random numbers # ~hint
This example displays a random number every time the crocodile clip holds `GND` then connects and disconnects the `P0` pin. Each time the crocodile clip is firmly connected and disconnected from pin `P0`, the micro:bit will return a random Number between 0 and the parameter limit **No crocodile clips!?!?!** Use wires or Aluminium foil! [Read more...](/device/foil-circuits)
# ~
## Connecting Crocodile Clips
The hole for ``P0`` and ``GND`` allow to grab the board on the side which makes for a great grip.
![](/static/mb/device/croc-clips/crocclipsclamped.jpg)
Pass one jaw in the hole and grab the side of the board with the other jaw.
![](/static/mb/device/croc-clips/sideclamp.jpg)
For the center holes, ``P1`` and ``P2``, you can also grab the bottom of the board but they are a bit harder to grip.
You can also grip the board between the jaws. In which case, you will want to make sure to avoid overlapping the jaws
with the other pins as it will create short-circuit in the board.
![](/static/mb/device/croc-clips/badclamp.jpg)
Adding a little tape helps keeping the crocodile clips in place.
![](/static/mb/device/croc-clips/frontclamp.jpg)
## Example: on pin pressed with random numbers
This example displays a random number every time the crocodile clip holds `GND` then connects and disconnects the `P0` pin.
Each time the crocodile clip is firmly connected and disconnected from pin `P0`, the micro:bit will return a random Number between 0 and the parameter limit.
```blocks ```blocks
input.onPinPressed(TouchPin.P0, () => { input.onPinPressed(TouchPin.P0, () => {
@ -13,11 +42,6 @@ input.onPinPressed(TouchPin.P0, () => {
}) })
``` ```
### Connecting Crocodile Clips ## See also
![](/static/mb/crocodile-clips-2.jpg)
### See also
[micro:bit pins](/device/pins), [pin is pressed](/reference/input/pin-is-pressed), [analog read pin](/reference/pins/analog-read-pin), [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin)
[micro:bit pins](/device/pins)

View File

@ -1,7 +1,5 @@
# Error codes # Error codes
The micro:bit error codes
Your micro:bit may encounter a situation that prevents it from running your code. When this happens, a frowny face will appear on your micro:bit screen (see picture) followed by an error number. Your micro:bit may encounter a situation that prevents it from running your code. When this happens, a frowny face will appear on your micro:bit screen (see picture) followed by an error number.
Below is a list of error numbers and what they mean: Below is a list of error numbers and what they mean:

View File

@ -0,0 +1,52 @@
# foil circuits
The large holes at the bottom of the board are designed to attach alligator/crocodile clips
to create electrical circuit with other components.
If you do not have crocodile clips at hand, dyou can use wires or even Aluminium foil to acheive the same result.
We will show you how to connect the micro:bit to headphones using Alumunium foil and tape.
https://youtu.be/mhXYyPuvpz0
### Materials
* micro:bit and battery pack (you can also power it via USB)
* a small piece of cardboard
* Aluminium foil
* tape
### Assembly instructions
Tape the micro:bit and battery pack to the card board. Make sure to remove the batteries while you are building your circuit.
![](/static/mb/device/croc-clips/microbitattached.jpg)
Cut the thinest strip of foil possible and roll it into a cable. You can also try to fold, whatever works for you.
Build two of those wires.
![](/static/mb/device/croc-clips/foilcut.jpg)
Place the foil wire on the ``GND`` pin and attach with a piece of tape. Press hard to get the best connection between
the foil and the pin board. Make sure the foil is not overlapping with the other pins!
![](/static/mb/device/croc-clips/groundconnected.jpg)
Place the second wire on the ``P0`` pin the same way. Make sure the wire does not overlap with the other pins!
![](/static/mb/device/croc-clips/microbitconnect.jpg)
Tape the headphone jack connector to the cardboard and roll the wire coming from ``GND`` around the metal base.
Make sure the wire does not touch the other metal rings on the jack.
![](/static/mb/device/croc-clips/jackground.jpg)
Tape the second wire on the head of the jack connector.
![](/static/mb/device/croc-clips/jackconnect.jpg)
![](/static/mb/device/croc-clips/foilcircuit.jpg)
## See also
[micro:bit pins](/device/pins)

View File

@ -29,7 +29,7 @@ Unfortunately, using the serial library requires quite a bit of a setup.
If you are using the Google Chrome browser, you can use our extension to get serial data streaming in the editor. If you are using the Google Chrome browser, you can use our extension to get serial data streaming in the editor.
* Install the [Extension for BBC micro:bit](https://chrome.google.com/webstore/detail/extension-for-bbc-microbi/cihhkhnngbjlhahcfmhekmbnnjcjdbge?hl=en-US) on the Chrome Web Store. * Install the [Extension for BBC micro:bit](https://chrome.google.com/webstore/detail/extension-for-bbc-microbi/cihhkhnngbjlhahcfmhekmbnnjcjdbge?hl=en-US) on the Chrome Web Store.
* Restart Chrome and open the [web editor](https://codethemicrobit.com) * Restart Chrome and open the [web editor](https://pxt.microbit.org)
* The serial data will show below the simulator * The serial data will show below the simulator
### Windows ### Windows

View File

@ -34,7 +34,7 @@ it appears as a new drive under Devices.
## Step 2: Download your program ## Step 2: Download your program
1. Open your project on [codethemicrobit.com](https://codethemicrobit.com) 1. Open your project on [pxt.microbit.org](https://pxt.microbit.org)
2. Click **Download** 2. Click **Download**
3. When prompted, choose to **save** the compiled file onto your computer. The 3. When prompted, choose to **save** the compiled file onto your computer. The
prompt will be different depending on which browser you are using, or prompt will be different depending on which browser you are using, or

View File

@ -34,7 +34,7 @@ it appears as a new drive under Devices.
## Step 2: Download your program ## Step 2: Download your program
1. Open your project on [codethemicrobit.com](https://codethemicrobit.com) 1. Open your project on [pxt.microbit.org](https://pxt.microbit.org)
2. Click **Download** 2. Click **Download**
3. When prompted, choose to **save** the compiled file onto your computer. The 3. When prompted, choose to **save** the compiled file onto your computer. The
prompt will be different depending on which browser you are using, or prompt will be different depending on which browser you are using, or

View File

@ -34,7 +34,7 @@ it appears as a new drive under Devices.
## Step 2: Download your program ## Step 2: Download your program
1. Open your project on [codethemicrobit.com](https://codethemicrobit.com) 1. Open your project on [pxt.microbit.org](https://pxt.microbit.org)
2. Click **Download** 2. Click **Download**
3. When prompted, choose to **save** the compiled file onto your computer. The 3. When prompted, choose to **save** the compiled file onto your computer. The
prompt will be different depending on which browser you are using, or prompt will be different depending on which browser you are using, or

View File

@ -41,7 +41,7 @@ it appears as a new drive under Devices.
## Step 2: Download your program ## Step 2: Download your program
1. Open your project on [codethemicrobit.com](https://codethemicrobit.com) 1. Open your project on [pxt.microbit.org](https://pxt.microbit.org)
2. Click **Download** 2. Click **Download**
3. When prompted, choose to **save** the compiled file onto your computer. The 3. When prompted, choose to **save** the compiled file onto your computer. The
prompt will be different depending on which browser you are using, or prompt will be different depending on which browser you are using, or

View File

@ -43,7 +43,7 @@ it appears as a new drive under Devices.
## Step 2: Download your program ## Step 2: Download your program
1. Open your project on [codethemicrobit.com](https://codethemicrobit.com) 1. Open your project on [pxt.microbit.org](https://pxt.microbit.org)
2. Click **Download** 2. Click **Download**
3. When prompted, choose to **save** the compiled file onto your computer. The 3. When prompted, choose to **save** the compiled file onto your computer. The
prompt will be different depending on which browser you are using, or prompt will be different depending on which browser you are using, or

View File

@ -43,7 +43,7 @@ it appears as a new drive under Devices.
## Step 2: Download your program ## Step 2: Download your program
1. Open your project on [codethemicrobit.com](https://codethemicrobit.com) 1. Open your project on [pxt.microbit.org](https://pxt.microbit.org)
2. Click **Download** 2. Click **Download**
3. When prompted, choose to **save** the compiled file onto your computer. The 3. When prompted, choose to **save** the compiled file onto your computer. The
prompt will be different depending on which browser you are using, or prompt will be different depending on which browser you are using, or

View File

@ -41,7 +41,7 @@ it appears as a new drive under Devices.
## Step 2: Download your program ## Step 2: Download your program
1. Open your project on [codethemicrobit.com](https://codethemicrobit.com) 1. Open your project on [pxt.microbit.org](https://pxt.microbit.org)
2. Click **Download** 2. Click **Download**
3. When prompted, choose to **save** the compiled file onto your computer. The 3. When prompted, choose to **save** the compiled file onto your computer. The
prompt will be different depending on which browser you are using, or prompt will be different depending on which browser you are using, or

View File

@ -5,7 +5,8 @@
### Things to do ### Things to do
* **[Getting Started](/getting-started)** * **[Getting Started](/getting-started)**
* [Ten projects](/projects) * [Projects](/projects)
* [Lessons](/lessons)
### Micro:bit reference ### Micro:bit reference
@ -16,16 +17,15 @@
* [Blocks language](/blocks) * [Blocks language](/blocks)
* [JavaScript language](/javascript) * [JavaScript language](/javascript)
* [Streaming data](/streaming)
### More questions? ### More questions?
* [Frequently Asked Question](/faq) * [Frequently Asked Question](/faq)
* [Embedding project](/share)
* [Help Translate](/translate) * [Help Translate](/translate)
* [Release notes](/release-notes) * [Embedding project](/share)
### Developers ### Developers
* [Command Line Interface](/cli) * [Command Line Interface](/cli)
* Learn about [packages](/packages) * Learn about [packages](/packages)
* [Release notes](/release-notes)

View File

@ -2,33 +2,4 @@
### @description Frequently asked questions and answers from our users. ### @description Frequently asked questions and answers from our users.
### Where can I get a BBC micro:bit? Please search for solutions or open a ticket at [support.microbit.org](https://support.microbit.org)!
More information at [http://uk.farnell.com/bbc-microbit](http://uk.farnell.com/bbc-microbit).
### How do I send feedback?
Find the small bubble icon on the bottom of the editor and
post your feedback from there!
### How do I save my code?
The web editor automatically saves your code in the browser cache. Simply reopen the browser and navigate to the web editor
to reopen your latest project. You can also open previous project stored locally through **More -> Open Project**.
The project source is also stored in each compiled ``.hex`` file. Drag and drop the ``.hex`` file into the web editor to load the project.
To share your project with others, you can use the [Embed Project...](/share).
It stores your project in the cloud and creates a URL that you can share with others.
If you are using [Visual Studio Code](/code), all your programs are stored as files on your computer and you can use your favorite source control system as needed.
## Is the web site available in other languages?
You can [help us translate](/translate) the web site, documentation and blocks via our crowd-source translations!
## Troubleshooting
### My micro:bit does not show up as a drive when I connect it to my computer.
A common cause for this is a broken cable. Pick another USB cable and try it. Otherwise, try another computer as well.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 15 KiB

3
docs/index-ref.json Normal file
View File

@ -0,0 +1,3 @@
{
"appref": "v0.5.51"
}

View File

@ -41,8 +41,8 @@ In JavaScript, there is the concept of an *empty statement*, which is whitespace
a semicolon in the context where a statement is expected. a semicolon in the context where a statement is expected.
So, the following code is an infinite loop So, the following code is an infinite loop
followed by a call to `showNumber` that will never execute: followed by a call to `showNumber` that will never execute:
```typescript ```typescript-ignore
while(true) ; while(true) ;
basic.showNumber(1); basic.showNumber(1);
``` ```

View File

@ -51,6 +51,8 @@ I'll be ${ age + 1 } years old next month.`
This is equivalent to declaring `sentence` like so: This is equivalent to declaring `sentence` like so:
```ts ```ts
let fullName: string = `Bob Bobbington`;
let age: number = 37;
let sentence: string = "Hello, my name is " + fullName + ".\n\n" + let sentence: string = "Hello, my name is " + fullName + ".\n\n" +
"I'll be " + (age + 1) + " years old next month." "I'll be " + (age + 1) + " years old next month."
``` ```
@ -82,7 +84,7 @@ A helpful addition to the standard set of datatypes from JavaScript is the `enum
As in languages like C#, an enum is a way of giving more friendly names to sets of numeric values. As in languages like C#, an enum is a way of giving more friendly names to sets of numeric values.
```ts ```ts
enum Color {Red, Green, Blue}; enum Color {Red, Green, Blue}
let c: Color = Color.Green; let c: Color = Color.Green;
``` ```
@ -91,14 +93,14 @@ You can change this by manually setting the value of one of its members.
For example, we can start the previous example at `1` instead of `0`: For example, we can start the previous example at `1` instead of `0`:
```ts ```ts
enum Color {Red = 1, Green, Blue}; enum Color {Red = 1, Green, Blue}
let c: Color = Color.Green; let c: Color = Color.Green;
``` ```
Or, even manually set all the values in the enum: Or, even manually set all the values in the enum:
```ts ```ts
enum Color {Red = 1, Green = 2, Blue = 4}; enum Color {Red = 1, Green = 2, Blue = 4}
let c: Color = Color.Green; let c: Color = Color.Green;
``` ```

View File

@ -6,43 +6,43 @@ a game similar to "Simon Says" with the BBC micro:bit.
Complete the following guided tutorial. Your code should look like this: Complete the following guided tutorial. Your code should look like this:
```blocks ```typescript
newAction() // *** let action = 0;
function newAction() {}
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {
if (action == 0) { if (action == 0) {
game.addScore(1) // *** game.addScore(1);
newAction() // *** newAction();
} }
}) // *** })
input.onLogoDown(() => { input.onLogoDown(() => {
if (action == 1) { if (action == 1) {
game.addScore(1) // *** game.addScore(1);
newAction() newAction();
} }
}) })
input.onGesture(Gesture.Shake, () => { input.onGesture(Gesture.Shake, () => {
if (action == 2) { if (action == 2) {
game.addScore(1) game.addScore(1);
newAction() newAction();
} }
}) })
input.onButtonPressed(Button.B, () => { input.onButtonPressed(Button.B, () => {
basic.showNumber(game.score(), 150) // *** basic.showNumber(game.score(), 150);
basic.pause(2000) // *** basic.pause(2000);
newAction() // *** newAction();
}) })
``` ```
### Challenge 1 ### Challenge 1
Now let's add some more types of instructions for the player to follow. Let's add `PRESS PIN 0`. Change the global variable `action` to `math->random(4)` so that we can add a new **IF** statement that checks if `action=3`. If it does, display instructions to press pin 0. Now let's add some more types of instructions for the player to follow. Let's add `PRESS PIN 0`.
Change the global variable `action` to `math->random(4)` so that we can add a new **IF** statement that checks if `action=3`. If it does, display instructions to press pin 0.
```blocks ```typescript
/** let action = 0;
* {highlight}
*/
export function newAction() { export function newAction() {
action = Math.random(4) // *** action = Math.random(4)
if (action == 0) { if (action == 0) {
basic.showString("PUSH A", 150) // *** basic.showString("PUSH A", 150) // ***
} }
@ -62,19 +62,22 @@ export function newAction() {
Now let's implement `PRESS PIN 0` in the main. Create a condition of `input->on pin pressed("P0")` that will add one to the score and calls the method `new action`. Now let's implement `PRESS PIN 0` in the main. Create a condition of `input->on pin pressed("P0")` that will add one to the score and calls the method `new action`.
```blocks ```typescript
// **. . .** let action = 0;
export function newAction() {
// ...
}
input.onButtonPressed(Button.B, () => { input.onButtonPressed(Button.B, () => {
basic.showNumber(game.score(), 150) // *** basic.showNumber(game.score(), 150)
basic.pause(2000) // *** basic.pause(2000)
newAction() // *** newAction()
}) // *** })
input.onPinPressed(TouchPin.P0, () => { input.onPinPressed(TouchPin.P0, () => {
if (action == 3) { if (action == 3) {
game.addScore(1) // *** game.addScore(1)
newAction() // *** newAction()
} }
}) // *** })
``` ```
### Challenge 3 ### Challenge 3

View File

@ -88,5 +88,5 @@ Have fun reviewing your simulation and analyze the acceleration by chart the Exc
* Display acceleration with y or z using plot bar graph by changing acceleration from "x" to "y" or "z" * Display acceleration with y or z using plot bar graph by changing acceleration from "x" to "y" or "z"
```package ```package
microbit-radio radio
``` ```

View File

@ -29,6 +29,7 @@ Write the line of code that will display the string "puppy" using `data->coll`.
<br/> <br/>
```blocks ```blocks
let coll: string[] = []
basic.showString(coll[0], 150) basic.showString(coll[0], 150)
``` ```
@ -46,6 +47,7 @@ Write the line of code that will display the string "cat" using `data->coll`.
<br/> <br/>
```blocks ```blocks
let coll: string[] = []
basic.showString(coll[2], 150) basic.showString(coll[2], 150)
``` ```

View File

@ -44,5 +44,5 @@ radio.onDataReceived(() => { })
* learn how to pause your code for the specified number of milliseconds * learn how to pause your code for the specified number of milliseconds
```package ```package
microbit-radio radio
``` ```

View File

@ -164,5 +164,5 @@ Connect the second micro:bit to your computer using your USB cable and run the p
The first person and second person take turns jumping in the “y” direction while the other player uses the micro:bit to track the results on the micro:bit! The first person and second person take turns jumping in the “y” direction while the other player uses the micro:bit to track the results on the micro:bit!
```package ```package
microbit-radio radio
``` ```

View File

@ -35,5 +35,5 @@ radio.receiveNumber();
* learn how to read the connector value as analog as a value comprised between 0 and 1023 * learn how to read the connector value as analog as a value comprised between 0 and 1023
```package ```package
microbit-radio radio
``` ```

View File

@ -196,5 +196,5 @@ Let's select Style 10 as an example.
* Review and analyze the actual micro:bit device acceleration data on Excel * Review and analyze the actual micro:bit device acceleration data on Excel
```package ```package
microbit-radio radio
``` ```

View File

@ -25,8 +25,9 @@ let randomArrow = Math.random(4)
<br/> <br/>
```blocks ```blocks
let randomArrow = Math.random(4);
if (randomArrow == 1) { if (randomArrow == 1) {
basic.plotImage(` basic.showLeds(`
. . # . . . . # . .
. . # . . . . # . .
# # # # # # # # # #
@ -43,8 +44,9 @@ if (randomArrow == 1) {
<br /> <br />
```blocks ```blocks
let randomArrow = Math.random(4);
if (randomArrow == 2) { if (randomArrow == 2) {
basic.plotImage(` basic.showLeds(`
. . # . . . . # . .
. . # # . . . # # .
# # # # # # # # # #

View File

@ -2,7 +2,7 @@
## Web application ## Web application
**https://codethemicrobit.com is an HTML5 web application** that automatically gets cached locally by your browser. **https://pxt.microbit.org is an HTML5 web application** that automatically gets cached locally by your browser.
Once the web app is loaded and you have compiled at least once, you will have all the code needed to work without an internet connection. Once the web app is loaded and you have compiled at least once, you will have all the code needed to work without an internet connection.
## Command line interface ## Command line interface

View File

@ -70,6 +70,19 @@ Fun games to build with your micro:bit.
}] }]
``` ```
## From the community
Projects contributed by the micro:bit community
```codecard
[{
"name": "Magic Button Trick",
"url":"/projects/magic-button-trick",
"imageUrl":"/static/mb/projects/magic-button-trick.png"
}]
```
### See Also ### See Also
[Flashing Heart](/projects/flashing-heart), [Smiley Buttons](/projects/smiley-buttons), [Love Meter](/projects/love-meter), [Rock Paper Scissors](/projects/rock-paper-scissors), [Compass](/projects/compass), [Hack your headphones](/projects/hack-your-headphones), [Banana keyboard](/projects/banana-keyboard), [Telegraph](/projects/telegraph), [Radio](/projects/radio), [Guitar](/projects/guitar), [Watch](/projects/the-watch) [Flashing Heart](/projects/flashing-heart), [Smiley Buttons](/projects/smiley-buttons), [Love Meter](/projects/love-meter), [Rock Paper Scissors](/projects/rock-paper-scissors), [Compass](/projects/compass), [Hack your headphones](/projects/hack-your-headphones), [Banana keyboard](/projects/banana-keyboard), [Telegraph](/projects/telegraph), [Radio](/projects/radio), [Guitar](/projects/guitar), [Watch](/projects/the-watch)

View File

@ -7,11 +7,12 @@
```sim ```sim
basic.forever(() => { basic.forever(() => {
basic.showLeds(` basic.showLeds(`
. # . # . . # . # .
# # # # # # # # # #
# # # # # # # # # #
. # # # . . # # # .
. . # . .`); . . # . .`
);
basic.pause(500); basic.pause(500);
basic.clearScreen(); basic.clearScreen();
basic.pause(500); basic.pause(500);
@ -29,11 +30,12 @@ Use [show leds](/reference/basic/show-leds) and make your code look like this:
```blocks ```blocks
basic.showLeds(` basic.showLeds(`
. # . # . . # . # .
# # # # # # # # # #
# # # # # # # # # #
. # # # . . # # # .
. . # . .`); . . # . .`
);
``` ```
## Step 2 ## Step 2
@ -42,11 +44,11 @@ Add a [pause](/reference/basic/pause) to wait and [clear screen](/reference/basi
```blocks ```blocks
basic.showLeds(` basic.showLeds(`
. # . # . . # . # .
# # # # # # # # # #
# # # # # # # # # #
. # # # . . # # # .
. . # . .`); . . # . .`);
basic.pause(500); basic.pause(500);
basic.clearScreen(); basic.clearScreen();
``` ```
@ -58,11 +60,12 @@ Put a [forever loop](/reference/basic/forever) around it.
```blocks ```blocks
basic.forever(() => { basic.forever(() => {
basic.showLeds(` basic.showLeds(`
. # . # . . # . # .
# # # # # # # # # #
# # # # # # # # # #
. # # # . . # # # .
. . # . .`); . . # . .`
);
basic.pause(500); basic.pause(500);
basic.clearScreen(); basic.clearScreen();
}) })
@ -75,11 +78,12 @@ Add a [pause](/reference/basic/pause) to wait after clearing the screen.
```blocks ```blocks
basic.forever(() => { basic.forever(() => {
basic.showLeds(` basic.showLeds(`
. # . # . . # . # .
# # # # # # # # # #
# # # # # # # # # #
. # # # . . # # # .
. . # . .`); . . # . .`
);
basic.pause(500); basic.pause(500);
basic.clearScreen(); basic.clearScreen();
basic.pause(500); basic.pause(500);
@ -94,20 +98,22 @@ Add a second image of a broken heart.
```blocks ```blocks
basic.forever(() => { basic.forever(() => {
basic.showLeds(` basic.showLeds(`
. # . # . . # . # .
# # # # # # # # # #
# # # # # # # # # #
. # # # . . # # # .
. . # . .`); . . # . .`
);
basic.pause(500); basic.pause(500);
basic.clearScreen(); basic.clearScreen();
basic.pause(500); basic.pause(500);
basic.showLeds(` basic.showLeds(`
. # . # . . # . # .
# . # # # # . # # #
# . . . # # . . . #
. # # # . . # # # .
. . # . .`); . . # . .`
);
basic.pause(500); basic.pause(500);
basic.clearScreen(); basic.clearScreen();
basic.pause(500); basic.pause(500);

View File

@ -43,7 +43,7 @@ music.beat(BeatFraction.Quarter)
``` ```
## Step 1: Make a Smiley ## Step 1: Make a Smiley
Open [codethemicrobit.com](https://codethemicrobit.com) in your web browser Open [pxt.microbit.org](https://pxt.microbit.org) in your web browser
```blocks ```blocks
basic.showLeds(` basic.showLeds(`
. # . # . . # . # .

View File

@ -21,9 +21,15 @@ Build your own music player micro:bit from headphones.
## Activities ## Activities
* [Connect your headphone](/projects/hack-your-headphone/making) * [Connect your headphone](/projects/hack-your-headphones/making)
* [Play sounds!]() * [Play sounds!]()
# ~hint
**No crocodile clips!?!?!** Use wires or Aluminium foil! [Read more...](/device/foil-circuits)
# ~
### ~button /projects/hack-your-headphones/making ### ~button /projects/hack-your-headphones/making
Let's get started! Let's get started!

View File

@ -6,6 +6,12 @@ Did you know you could attach your headhpones to the micro:bit to generate sound
### ~ ### ~
# ~hint
**No crocodile clips!?!?!** Use wires or Aluminium foil! [Read more...](/device/foil-circuits)
# ~
### Step 1 ### Step 1
![](/static/mb/lessons/banana-keyboard-1.png) ![](/static/mb/lessons/banana-keyboard-1.png)

View File

@ -0,0 +1,101 @@
# magic button trick
Perform a magic trick where you appear to make the **A** and **B** button of your micro:bit swap over just by moving a sticky label.
### ~avatar avatar
Welcome! This activity will teach you how to use the micro:bit's compass to detect a nearby magnet
### ~
This is a simple magic trick you can perform to amaze your friends, where by moving the sticky labels on your micro:bit's **A** and **B** button you appear to make the buttons really switch over. To see the trick performed watch the video below.
https://youtu.be/-9KvmPopov8
## How the trick works
Unfortunately, the only magic here is in the code. This trick uses a magnet, hidden in your hand, to tell the micro:bit to swap over the buttons so that when the magnet is near the microbit the **A** button starts working like the **B** button and the **B** button starts working like the **A** button.
## What you need
The only things you need for this trick are your micro:bit and any magnet that is small enough to fit in your hand, even a fridge magnet will work.
![](/static/mb/projects/magic-button-trick/magnets.jpg "Magnets")
## Step 1: getting the buttons to display **A** and **B**
Before we code the trick itself, we need to get the buttons working as you would expect them to so that pressing button **A** displays 'A' and pressing button **B** displays 'B':
```blocks
input.onButtonPressed(Button.A, () => {
basic.showString("A")
})
input.onButtonPressed(Button.B, () => {
basic.showString("B")
})
```
## Step 2: measuring magnetic force
We will use the micro:bit's compass to detect the magnet. Compass's tell us what direction we are pointing by detecting the Earth's magnetic field but they can also detect any other magnet nearby. We will use that to check if our magnet is next to the micro:bit by using the [magnetic force](/reference/input/magnetic-force) block found in the input menu's 'more' section. As we only want to measure the strength we change the drop down to select 'strength':
```blocks
input.magneticForce(Dimension.Strength)
```
## Step 3: checking if the magnetic is nearby
Now we can measure the magnetic force near the microbit, we can check if the value we measure is so big that it means there must be a strong magnet nearby.
If you have ever played with magnets you know they have two ends, often called a north and south 'pole'. Depending on which end of the magnet is pointing at the microbit the magnetic force measurement will either be a negative number like -100 or a positive number like 100. We just want to know if the strength is at least 100 we don't care if its negative or positive so we also use the 'absolute value of' block from the maths menu to tell our code to ignore the negative sign and just treat -100 as if its 100.
So in the code below we will check if the absolute value of our magnetic field strength reading is more than 100 and save the result of that check in a new variable called 'isSwitched':
```blocks
let isSwitched = Math.abs(input.magneticForce(Dimension.Strength)) > 100
```
## Step 4: running our 'magnet nearby' check all the time
At the moment our code to detect the magnet being nearby will only run once so we need to put it into a [forever](/reference/basic/forever) block so that it keeps getting run again and again checking for the magnet to come near to the micro:bit. We should also make sure 'isSwitched' is false when our program starts.
```blocks
let isSwitched = false;
basic.forever(() => {
let isSwitched = Math.abs(input.magneticForce(Dimension.Strength)) > 100
})
```
## Step 5: swapping the buttons when we know the magnet is nearby
Now we can check the value of our variable 'isSwitched' whenever we want and we will know that the magnet is nearby if it's value is 'true'. Let's use that to change how the buttons work and complete the code for our trick. We will add an 'if, else' block to each button's code and check if we should swap over what each button displays because 'isSwitched' is equal to true:
```blocks
let isSwitched = false;
basic.forever(() => {
isSwitched = Math.abs(input.magneticForce(Dimension.Strength)) > 100
})
input.onButtonPressed(Button.A, () => {
if (isSwitched) {
basic.showString("B")
} else {
basic.showString("A")
}
})
input.onButtonPressed(Button.B, () => {
if (isSwitched) {
basic.showString("A")
} else {
basic.showString("B")
}
})
```
## step 5: practice your performance
Now you just need to program your own micro:bit and practice the trick a few times before performing to friends. Try asking your friends to click the buttons after you have switched the labels and the trick won't work for them as they don't have a hidden magnet in their hand.
## about the authors
This project was contributed by Brian and Jasmine Norman, aka [@MicroMonstersUK](https://twitter.com/MicroMonstersUK). You can chekout their [micro:bit tutorials chanel on youtube](https://www.youtube.com/channel/UCK2DviDexh_Er2QYZerZyZQ) for more projects.

View File

@ -61,5 +61,5 @@ radio.onDataReceived(() => {
```package ```package
microbit-radio radio
``` ```

View File

@ -90,5 +90,5 @@ Have fun reviewing your simulation and analyze the acceleration by chart the Exc
* Display acceleration with y or z using plot bar graph by changing acceleration from "x" to "y" or "z" * Display acceleration with y or z using plot bar graph by changing acceleration from "x" to "y" or "z"
```package ```package
microbit-radio radio
``` ```

View File

@ -10,11 +10,12 @@ Use [show leds](/reference/basic/show-leds) to make a smiley face:
```blocks ```blocks
basic.showLeds(` basic.showLeds(`
. # . # . . # . # .
. # . # . . # . # .
. . . . . . . . . .
# . . . # # . . . #
. # # # .`); . # # # .`
);
``` ```
## Step 2 ## Step 2
@ -24,18 +25,20 @@ frowny face inside it:
```blocks ```blocks
basic.showLeds(` basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .`);
input.onButtonPressed(Button.A, () => {
basic.showLeds(`
. # . # . . # . # .
. # . # . . # . # .
. . . . . . . . . .
. # # # . # . . . #
# . . . #`); . # # # .`
);
input.onButtonPressed(Button.A, () => {
basic.showLeds(`
. # . # .
. # . # .
. . . . .
. # # # .
# . . . #`
);
}); });
``` ```
@ -45,25 +48,28 @@ Now add blocks so that when [button B is pressed](/reference/input/button-is-pre
```blocks ```blocks
basic.showLeds(` basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .`);
input.onButtonPressed(Button.A, () => {
basic.showLeds(`
. # . # .
. # . # .
. . . . .
. # # # .
# . . . #`);
});
input.onButtonPressed(Button.B, () => {
basic.showLeds(`
. # . # . . # . # .
. # . # . . # . # .
. . . . . . . . . .
# . . . # # . . . #
. # # # .`); . # # # .`
);
input.onButtonPressed(Button.A, () => {
basic.showLeds(`
. # . # .
. # . # .
. . . . .
. # # # .
# . . . #`
);
});
input.onButtonPressed(Button.B, () => {
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .`
);
}); });
``` ```

View File

@ -8,7 +8,6 @@ We now need to digitally write to pin ``P0`` as **high** (1).
```blocks ```blocks
pins.digitalWritePin(DigitalPin.P0, 1) pins.digitalWritePin(DigitalPin.P0, 1)
``` ```
### Step 2 ### Step 2
@ -19,7 +18,6 @@ So insert the appropriate LED plot x, y.
```blocks ```blocks
pins.digitalWritePin(DigitalPin.P0, 1) pins.digitalWritePin(DigitalPin.P0, 1)
led.plot(2, 2) led.plot(2, 2)
``` ```
### Step 3 ### Step 3
@ -31,9 +29,7 @@ Then add a condition that occurs if we do not turn on a LED with plot x, y. We a
if (input.buttonIsPressed(Button.A)) { if (input.buttonIsPressed(Button.A)) {
pins.digitalWritePin(DigitalPin.P0, 1) pins.digitalWritePin(DigitalPin.P0, 1)
led.plot(2, 2) led.plot(2, 2)
} else { } else { }
}
``` ```
@ -63,7 +59,8 @@ basic.forever(() => {
} else { } else {
pins.digitalWritePin(DigitalPin.P0, 0) pins.digitalWritePin(DigitalPin.P0, 0)
led.unplot(2, 2) led.unplot(2, 2)
}) }
})
``` ```
### Step 6 ### Step 6
@ -87,9 +84,6 @@ basic.forever(() => {
basic.clearScreen(); basic.clearScreen();
} }
}); });
``` ```
Your telegraph is ready! Your telegraph is ready!

View File

@ -87,7 +87,7 @@ The gate is ready to use! Your circuit should look like the picture below:
## Detecting the car with code ## Detecting the car with code
The micro:bit provides an event [on pin pressed](/reference/pins/on-pin-pressed) The micro:bit provides an event [on pin pressed](/reference/input/on-pin-pressed)
that is raised when a circuit between ``GND`` and a pin is detected. The circuit conductor could be a wire or even your body! that is raised when a circuit between ``GND`` and a pin is detected. The circuit conductor could be a wire or even your body!
We will attach a foil to the bottom of the car. When it passes over the gate, it connect both foil strips, close the circuit and trigger the event. We will attach a foil to the bottom of the car. When it passes over the gate, it connect both foil strips, close the circuit and trigger the event.
@ -146,7 +146,7 @@ Connect the crocodile plugs to the ``GND`` and ``P1`` pins on the micro:bit.
## Detecting the second gate ## Detecting the second gate
Since the second gate is connected to pin ``P1``, we add a second [on pin pressed](/reference/pins/on-pin-pressed) event Since the second gate is connected to pin ``P1``, we add a second [on pin pressed](/reference/input/on-pin-pressed) event
that display 2 columns of LEDs. that display 2 columns of LEDs.
```blocks ```blocks

View File

@ -5,7 +5,7 @@ with [Raspbian Jessie with Pixel](https://www.raspberrypi.org/downloads/raspbian
## Web editor ## Web editor
Starting with **Raspbian Pixel**, Raspbian comes with Chromium. Simply open [](https://codethemicrobit.com). Starting with **Raspbian Pixel**, Raspbian comes with Chromium. Simply open [](https://pxt.microbit.org).
## Command line ## Command line

View File

@ -37,9 +37,9 @@ bluetooth.onBluetoothConnected(() => {});
``` ```
```package ```package
microbit-radio radio
microbit-devices devices
microbit-bluetooth bluetooth
``` ```
### See Also ### See Also

View File

@ -35,4 +35,6 @@ basic.showAnimation(`
### See Also ### See Also
[showNumber](/reference/basic/show-number), [showLeds](/reference/basic/show-leds), [showString](/reference/basic/show-string), [clearScreen](/reference/basic/clear-screen), [forever](/reference/basic/forever), [pause](/reference/basic/pause), [plotLeds](/reference/basic/plot-leds), [showAnimation](/reference/basic/show-animation) [showNumber](/reference/basic/show-number), [showLeds](/reference/basic/show-leds), [showString](/reference/basic/show-string),
[clearScreen](/reference/basic/clear-screen), [forever](/reference/basic/forever), [pause](/reference/basic/pause),
[showAnimation](/reference/basic/show-animation)

View File

@ -2,6 +2,14 @@
Support for additional Bluetooth services. Support for additional Bluetooth services.
### ~hint
![](/static/bluetooth/Bluetooth_SIG.png)
For another device like a smartphone to use any of the Bluetooth "services" which the micro:bit has, it must first be [paired with the micro:bit](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the micro:bit and exchange data relating to many of the micro:bit's features.
### ~
```cards ```cards
bluetooth.startAccelerometerService(); bluetooth.startAccelerometerService();
bluetooth.startButtonService(); bluetooth.startButtonService();
@ -9,20 +17,34 @@ bluetooth.startIOPinService();
bluetooth.startLEDService(); bluetooth.startLEDService();
bluetooth.startMagnetometerService(); bluetooth.startMagnetometerService();
bluetooth.startTemperatureService(); bluetooth.startTemperatureService();
bluetooth.uartRead(""); bluetooth.onBluetoothConnected(() => {});
bluetooth.uartWrite(""); bluetooth.onBluetoothDisconnected(() => {});
bluetooth.onBluetoothConnected(() => { ```
}); ## UART
bluetooth.onBluetoothDisconnected(() => {
```cards
}); bluetooth.startUartService();
bluetooth.uartReadUntil("");
bluetooth.uartWriteString("");
bluetooth.uartWriteNumber(0);
bluetooth.uartWriteValue("", 0);
``` ```
```package ```package
microbit-bluetooth bluetooth
``` ```
### Advanced
For more advanced information on the micro:bit Bluetooth UART service including information on using a smartphone, see the [Lancaster University micro:bit runtime technical documentation](http://lancaster-university.github.io/microbit-docs/ble/uart-service/)
### See Also ### See Also
[startAccelerometerService](/reference/bluetooth/start-accelerometer-service), [startButtonService](/reference/bluetooth/start-button-service), [startIOPinService](/reference/bluetooth/start-io-pin-service), [startLEDService](/reference/bluetooth/start-led-service), [startMagnetometerService](/reference/bluetooth/start-magnetometer-service), [startTemperatureService](/reference/bluetooth/start-temperature-service), [uartRead](/reference/bluetooth/uart-read), [uartWrite](/reference/bluetooth/uart-write), [onBluetoothConnected](/reference/bluetooth/on-bluetooth-connected), [onBluetoothDisconnected](/reference/bluetooth/on-bluetooth-disconnected) [startAccelerometerService](/reference/bluetooth/start-accelerometer-service), [startButtonService](/reference/bluetooth/start-button-service), [startIOPinService](/reference/bluetooth/start-io-pin-service), [startLEDService](/reference/bluetooth/start-led-service), [startMagnetometerService](/reference/bluetooth/start-magnetometer-service), [startTemperatureService](/reference/bluetooth/start-temperature-service),
[startUartService](/reference/bluetooth/start-uart-service),
[uartReadUntil](/reference/bluetooth/uart-read-until),
[uartWriteString](/reference/bluetooth/uart-write-string),
[uartWriteNumber](/reference/bluetooth/uart-write-number),
[uartWriteValue](/reference/bluetooth/uart-write-value),
[onBluetoothConnected](/reference/bluetooth/on-bluetooth-connected), [onBluetoothDisconnected](/reference/bluetooth/on-bluetooth-disconnected)

View File

@ -95,5 +95,5 @@ https://www.youtube.com/watch?v=aep_GVowKfs
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com) [About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
```package ```package
microbit-bluetooth bluetooth
``` ```

View File

@ -96,5 +96,5 @@ If you do find yourself needing to pair again you will first need to remove the
```package ```package
microbit-bluetooth bluetooth
``` ```

View File

@ -33,5 +33,5 @@ http://www.youtube.com/watch?v=HyBcsD9Eh6I
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com) [About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
```package ```package
microbit-bluetooth bluetooth
``` ```

View File

@ -33,5 +33,5 @@ http://www.youtube.com/watch?v=HyBcsD9Eh6I
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com) [About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
```package ```package
microbit-bluetooth bluetooth
``` ```

View File

@ -38,5 +38,5 @@ For more advanced information on the micro:bit Bluetooth accelerometer service i
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com) [About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
```package ```package
microbit-bluetooth bluetooth
``` ```

View File

@ -42,5 +42,5 @@ For more advanced information on the micro:bit Bluetooth button service includin
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com) [About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
```package ```package
microbit-bluetooth bluetooth
``` ```

View File

@ -36,5 +36,5 @@ For more advanced information on the micro:bit Bluetooth IO pin service includin
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com) [About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
```package ```package
microbit-bluetooth bluetooth
``` ```

View File

@ -38,5 +38,5 @@ For more advanced information on the micro:bit Bluetooth LED service including i
[About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com) [About Bluetooth](/reference/bluetooth/about-bluetooth), [micro:bit Bluetooth profile overview ](http://lancaster-university.github.io/microbit-docs/ble/profile/), [micro:bit Bluetooth profile reference](http://lancaster-university.github.io/microbit-docs/resources/bluetooth/microbit-profile-V1.9-Level-2.pdf), [Bluetooth on micro:bit resources](http://bluetooth-mdw.blogspot.co.uk/p/bbc-microbit.html), [Bluetooth SIG](https://www.bluetooth.com)
```package ```package
microbit-bluetooth bluetooth
``` ```

Some files were not shown because too many files have changed in this diff Show More