Compare commits

...

264 Commits

Author SHA1 Message Date
63d3909cad 0.9.14 2017-02-22 13:26:09 -08:00
23e835b108 Update core strings 2017-02-22 13:25:47 -08:00
be1ea9a742 Pin number typo (#356) 2017-02-21 17:43:13 -08:00
8d33b4ded8 0.9.13 2017-02-21 12:10:56 -08:00
c58f847b33 Bump pxt-core to 0.11.41 2017-02-21 12:10:56 -08:00
19eff8e642 0.9.12 2017-02-17 23:22:45 -08:00
d53c8e9bef Bump pxt-core to 0.11.40 2017-02-17 23:22:44 -08:00
aea8299006 February beta to release. 2017-02-17 12:23:24 -08:00
90f63c597f 0.9.11 2017-02-17 12:14:50 -08:00
c4db344a85 Bump pxt-core to 0.11.39 2017-02-17 12:14:49 -08:00
0558e8945d 0.9.10 2017-02-17 11:46:54 -08:00
e90875d57d Bump pxt-core to 0.11.38 2017-02-17 11:46:53 -08:00
f4c1a65e7e 0.9.9 2017-02-17 11:06:07 -08:00
8dc88c44f2 Bump pxt-core to 0.11.37 2017-02-17 11:06:06 -08:00
acbe9106cc Updating small organization logo 2017-02-16 20:36:20 -08:00
652b09d5c4 0.9.8 2017-02-14 16:19:51 -08:00
e35312de70 Bump pxt-core to 0.11.36 2017-02-14 16:19:49 -08:00
82764ffcc1 0.9.7 2017-02-14 15:38:24 -08:00
f1404cef61 Bump pxt-core to 0.11.35 2017-02-14 15:38:22 -08:00
566b750419 0.9.6 2017-02-14 07:44:30 -08:00
b119952e75 Bump pxt-core to 0.11.33 2017-02-14 07:44:28 -08:00
e4e6a5effd updated translations 2017-02-14 07:39:09 -08:00
ec1117842d 0.9.5 2017-02-13 15:36:12 -08:00
de4242bf71 Bump pxt-core to 0.11.32 2017-02-13 15:36:10 -08:00
59322fb06b updated strings 2017-02-11 14:05:02 -08:00
19e609c245 Delay initializing the global icons (#354)
* delay initializing the global icons, so we don't generate them for each hex file

* Moving the strings to flash
2017-02-10 16:33:52 -08:00
a5cb663316 0.9.4 2017-02-09 22:52:07 -08:00
1dd0c1793e Bump pxt-core to 0.11.28 2017-02-09 22:52:05 -08:00
a4a74bdd6b adding a few more examples 2017-02-09 17:40:21 -08:00
45c82767d0 fixed titles 2017-02-09 14:57:38 -08:00
0c77927f35 fixing example page format 2017-02-09 14:51:12 -08:00
672672e632 adding example pages 2017-02-09 14:44:56 -08:00
fe2ae855b0 0.9.3 2017-02-09 11:02:28 -08:00
6612080885 Bump pxt-core to 0.11.27 2017-02-09 11:02:26 -08:00
8641a81e05 0.9.2 2017-02-08 21:09:06 -08:00
656e183a1a Bump pxt-core to 0.11.26 2017-02-08 21:09:01 -08:00
1d56be507a 0.9.1 2017-02-08 15:43:49 -08:00
6504007a65 bumped to v0.9 2017-02-08 15:43:41 -08:00
fc0526e47c 0.8.6 2017-02-08 15:42:54 -08:00
cb47a6a291 Bump pxt-core to 0.11.25 2017-02-08 15:42:52 -08:00
6f8060a8c7 allow analog operations on digital pins (#353) 2017-02-08 15:42:39 -08:00
4a8897c0a4 0.8.5 2017-02-07 22:52:08 -08:00
839a26e5a7 Bump pxt-core to 0.11.24 2017-02-07 22:52:06 -08:00
b46802804c 0.8.4 2017-02-07 14:19:03 -08:00
34d1fac337 Bump pxt-core to 0.11.22 2017-02-07 14:19:01 -08:00
39c41f26b1 0.8.3 2017-02-07 12:58:38 -08:00
083a192a5b Bump pxt-core to 0.11.20 2017-02-07 12:58:36 -08:00
76cbad0cec 0.8.2 2017-02-06 22:30:45 -08:00
ed84d49667 Bump pxt-core to 0.11.16 2017-02-06 22:30:43 -08:00
b9d867cf4e Enabled text blocks (#352) 2017-02-06 13:36:24 -08:00
226dfa281a 0.8.1 2017-02-03 20:39:55 -08:00
cc4f6c66da Bump pxt-core to 0.11.13 2017-02-03 20:39:54 -08:00
49ecac6332 Showimage (#351)
* support for interval in showImage, showFrame

* added default arg to showFrame
2017-02-03 20:39:18 -08:00
638e1d3c53 0.7.55 2017-02-03 15:44:29 -08:00
712bc0ada4 Bump pxt-core to 0.11.12 2017-02-03 15:44:26 -08:00
8437f0cf3c enable sharing 2017-02-03 15:23:46 -08:00
9641c4b5ec fixed pin-pressed 2017-02-02 23:26:55 -08:00
e29216c709 0.7.54 2017-02-02 23:22:56 -08:00
06e255eeb9 Bump pxt-core to 0.11.11 2017-02-02 23:22:54 -08:00
91c70e9809 0.7.53 2017-02-02 23:18:38 -08:00
8014712994 Bump pxt-core to 0.11.10 2017-02-02 23:18:36 -08:00
a7d5804cea 0.7.52 2017-02-01 16:46:58 -08:00
2e5984a65b Bump pxt-core to 0.11.9 2017-02-01 16:46:48 -08:00
c13bef01a4 remove image and move enum 2017-02-01 14:08:23 -08:00
16c08e4c9b 0.7.51 2017-02-01 09:50:31 -08:00
444c37edcb Bump pxt-core to 0.11.8 2017-02-01 09:50:31 -08:00
51781be90b Merge pull request #350 from Microsoft/icons
add icons/arrows/clock
2017-02-01 09:28:09 -08:00
741eb4e4b4 fixed typo in settings 2017-02-01 07:58:20 -08:00
350f595a52 0.7.50 2017-02-01 07:57:21 -08:00
06c392f16f Bump pxt-core to 0.11.7 2017-02-01 07:57:19 -08:00
4bf659c9ac updated translations 2017-02-01 07:57:10 -08:00
db4711fd26 remove hour, add advanced section 2017-01-31 15:54:23 -08:00
8275fefd08 change name 2017-01-31 14:56:56 -08:00
8c474c899c 0.7.49 2017-01-31 08:29:58 -08:00
48bb0e238a Bump pxt-core to 0.11.6 2017-01-31 08:29:56 -08:00
1d47b4de0d Lightmonster (#346)
* fixed boardname issues

* refactored servo info

* coffee cup monster lesson skeleton

* display event source id / value in advanced section

* normalized project structure

* updated project name

* Update projects.md
2017-01-31 08:29:25 -08:00
595e4a23e6 package approval docs (#344)
* updated docs

* @jaustin comments

* Update packages.md
2017-01-31 08:28:33 -08:00
2d3ca71ffb add meta data 2017-01-30 17:05:06 -08:00
3ba9d2867b add attribution 2017-01-30 16:51:40 -08:00
ff7b229a3a add one image to make it spiffy 2017-01-30 16:42:48 -08:00
f944af8122 get rid of images 2017-01-30 15:33:33 -08:00
35225468e4 add some images 2017-01-30 15:03:50 -08:00
72d5e83e5b Exposing pin eventOn method (#349) 2017-01-30 19:19:54 +00:00
436b56a2fa 0.7.48 2017-01-29 22:25:42 -08:00
7a41730f82 Bump pxt-core to 0.11.4 2017-01-29 22:25:41 -08:00
372ddfa641 0.7.47 2017-01-28 22:46:03 -08:00
30078923a3 Bump pxt-core to 0.11.3 2017-01-28 22:46:02 -08:00
5ab9222200 0.7.46 2017-01-28 21:59:48 -08:00
8ae5a48f1e Bump pxt-core to 0.11.2 2017-01-28 21:59:48 -08:00
f9ed37d07b Using pxtsemantic optimization 2017-01-28 21:55:48 -08:00
edfbc4da18 0.7.45 2017-01-28 11:57:24 -08:00
3a1c6a6ce3 Bump pxt-core to 0.11.1 2017-01-28 11:57:22 -08:00
9a4a2264fa Fixing singal strength docs and adding an example (#347) 2017-01-28 19:53:36 +00:00
e9558ce158 Fix svg scaling issue in IE. (#348)
* Fix svg scaling issue in IE. Fixes #1192

* minor fix
2017-01-28 19:53:05 +00:00
50677fadc4 Applying IE/Edge blockly css workaround 2017-01-26 14:47:15 -08:00
649e8f7c0f Fix neopixel transform in firefox (#345) 2017-01-26 02:51:26 +00:00
0cb9c28f8d Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-23 03:54:58 -08:00
004d9b4315 Adding pxt-microbit-GY521 repo 2017-01-23 03:52:53 -08:00
7a5b3aba01 Add hasAudio flag 2017-01-21 16:25:46 -08:00
dc30263642 0.7.44 2017-01-20 15:42:48 -08:00
619658a057 Bump pxt-core to 0.10.15 2017-01-20 15:42:46 -08:00
472846bf3c 0.7.43 2017-01-20 15:16:42 -08:00
ac4fbc850b Bump pxt-core to 0.10.14 2017-01-20 15:16:40 -08:00
c7054b7ee0 Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-20 15:16:29 -08:00
559a43e17b 0.7.42 2017-01-20 15:05:50 -08:00
7671bc46ad Bump pxt-core to 0.10.13 2017-01-20 15:05:49 -08:00
b3c5f2926d Electron release 0.7.41 2017-01-20 11:02:59 -08:00
28830aa905 more info on on-start 2017-01-19 17:51:48 -08:00
7fbbb5e65a release of beta 2017-01-19 16:55:20 -08:00
51ebc29887 0.7.41 2017-01-19 16:09:32 -08:00
f5d1722eae Bump pxt-core to 0.10.11 2017-01-19 16:09:29 -08:00
5f876d5ea9 Add openocd script (for pxt gdb) 2017-01-19 17:24:03 +00:00
31de8892fa Use standard type names
otherwise compilation fails on some yotta installs
2017-01-19 17:23:51 +00:00
0d0a68122d 0.7.40 2017-01-19 00:19:15 -08:00
4ad660568e Bump pxt-core to 0.10.10 2017-01-19 00:19:14 -08:00
58e82a571d 0.7.39 2017-01-18 16:14:11 -08:00
e629b866d5 Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-18 16:13:08 -08:00
f0ac2b7a05 fixing debug message 2017-01-18 16:12:58 -08:00
e3c8db28e4 0.7.38 2017-01-18 14:48:43 -08:00
2c0e19a120 Bump pxt-core to 0.10.9 2017-01-18 14:48:42 -08:00
595eb788b2 removed console.log for pxt.debug 2017-01-17 16:51:21 -08:00
2e15d22e9e 0.7.37 2017-01-17 16:29:52 -08:00
57082654a9 0.7.36 2017-01-17 14:55:44 -08:00
8cbf7d38e3 0.7.35 2017-01-17 14:51:28 -08:00
a99a7325bf 0.7.34 2017-01-17 14:13:06 -08:00
fa3ed9dd21 0.7.33 2017-01-17 11:37:35 -08:00
45fd40a553 adding on pin pressed in getting-started 2017-01-17 11:37:20 -08:00
5a18bea9eb 0.7.32 2017-01-17 11:28:38 -08:00
d310312841 Bump pxt-core to 0.10.8 2017-01-17 11:28:35 -08:00
a4b93f7199 support for deletable on start 2017-01-17 11:18:22 -08:00
538a4b7bbf 0.7.31 2017-01-13 18:11:03 -08:00
0078e7bc12 Bump pxt-core to 0.10.7 2017-01-13 18:11:02 -08:00
d2726133a9 Revert "Control event value in simulator (#343)"
This reverts commit 00f4c9cbb3.
2017-01-13 18:04:38 -08:00
00f4c9cbb3 Control event value in simulator (#343)
* implement pxsim.control.eventValue and pxsim.control.eventTimestamp in the simulator
2017-01-13 16:46:52 -08:00
e15da5dee1 0.7.30 2017-01-13 15:47:16 -08:00
85dda4ea84 Bump pxt-core to 0.10.4 2017-01-13 15:47:15 -08:00
a3ffe4e1cf Set latest Electron to 0.7.29 (#342) 2017-01-13 14:11:46 -08:00
90c4d4f73b 0.7.29 2017-01-13 13:55:44 -08:00
6484d559d6 Bump pxt-core to 0.10.2 2017-01-13 13:55:43 -08:00
357436f14d refactored servostate (#341)
* refactored servostate

* Bump pxt-core to 0.10.1
2017-01-12 23:09:53 -08:00
85fe96b3fd 0.7.28 2017-01-12 16:08:35 -08:00
cdac932c42 Bump pxt-core to 0.9.5 2017-01-12 16:08:32 -08:00
dcfc2a110d Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-12 16:07:19 -08:00
e9561f54c3 removing custom loader logic 2017-01-12 16:07:10 -08:00
86f6b58d38 fix"string compare works differently in simulator/on target" (#340)
* fix for "string compare works differently in simulator/on target", fixes #901
2017-01-12 15:50:39 -08:00
eee52a5c04 0.7.27 2017-01-12 15:27:07 -08:00
1a0b0eac71 Bump pxt-core to 0.9.4 2017-01-12 15:27:04 -08:00
5a98ae0bb8 0.7.26 2017-01-12 11:54:33 -08:00
a9eea9a618 Bump pxt-core to 0.9.3 2017-01-12 11:54:30 -08:00
3086c521e3 0.7.25 2017-01-12 11:33:08 -08:00
6788f79650 Bump pxt-core to 0.9.2 2017-01-12 11:33:05 -08:00
5900239045 changing editor button colors 2017-01-12 10:45:39 -08:00
248267ec2c 0.7.24 2017-01-10 17:47:09 -08:00
9429075555 Bump pxt-core to 0.8.14 2017-01-10 17:47:07 -08:00
1fa871f2e7 Support for serial events (#339)
* added "serial->on data received"

* updated info

* updated docs

* added readline to read entire buffer

* lazy initialize of serial buffers

* init async on event

* updated docs
2017-01-10 16:27:02 -08:00
04dab7df2c One letter showString shouldn't disappear (#338)
* Fix for "One letter showString shouldn't disappear", fixes #798

* miss semicolon
2017-01-10 16:25:40 -08:00
b6474467bc Electron release (#333)
Set latest Electron app release to 0.7.23
2017-01-10 14:16:13 -08:00
79ead74af4 0.7.23 2017-01-10 10:31:04 -08:00
0f8ff95b72 Bump pxt-core to 0.8.13 2017-01-10 10:30:58 -08:00
05028c4527 Serial events (#337)
* added "serial->on data received"

* updated info

* updated docs

* added readline to read entire buffer

* lazy initialize of serial buffers

* init async on event

* updated docs
2017-01-10 10:26:44 -08:00
4054da3483 0.7.22 2017-01-09 21:33:47 -08:00
7052d27d6d Bump pxt-core to 0.8.12 2017-01-09 21:33:44 -08:00
365af8d672 Merge pull request #335 from Microsoft/default
Default values for array
2017-01-09 20:35:56 -08:00
5086ca308c 0.7.21 2017-01-09 16:08:58 -08:00
c1af770afc Bump pxt-core to 0.8.11 2017-01-09 16:08:58 -08:00
e175e70d01 Merge branch 'master' into editortoolbox 2017-01-09 16:01:35 -08:00
cbc228dca3 negative scroll fix
fix for Microsoft/pxt#813
2017-01-09 14:17:19 -08:00
462127c661 Loader (#336)
* Custom microbit loader

* updated animation

* use standardized name

* moving loader support to pxt
2017-01-09 07:51:00 -08:00
487da05eca Fix for https://github.com/Microsoft/pxt/issues/1057 2017-01-09 10:58:24 +00:00
c938618d29 adding default values for beyond the array.length access 2017-01-08 19:08:09 -08:00
91321dab83 Support for default values in array. 2017-01-08 18:43:14 -08:00
0cb3d6e44e Changes accompanying the editor toolbox. 2017-01-07 17:35:54 -08:00
7a98b06424 Custom microbit loader (#334)
* Custom microbit loader

* updated animation

* use standardized name
2017-01-06 17:39:48 -08:00
69c80d3aff Add css and default icon to NPM package for Electron app (#332) 2017-01-06 16:29:48 -08:00
1d82f08668 update instructions to use inline buttons 2017-01-06 14:41:33 -08:00
4681a68ffd added avatar image 2017-01-06 09:51:19 -08:00
0a69b773de missing package annotation 2017-01-06 07:19:00 -08:00
3f66a1c16d 0.7.20 2017-01-06 07:13:39 -08:00
d78781ad5a Bump pxt-core to 0.8.8 2017-01-06 07:13:38 -08:00
46281c3cd0 fixing broken links in docs 2017-01-06 06:12:39 -08:00
a58f67064f 0.7.19 2017-01-06 06:03:43 -08:00
efe784441f Bump pxt-core to 0.8.7 2017-01-06 06:03:41 -08:00
05174f094a updated translations 2017-01-06 06:03:33 -08:00
42773a1a0a updatd weights of radio 2017-01-06 05:43:50 -08:00
32f96d09d4 removing "getting-started" link 2017-01-06 04:58:00 -08:00
05d88cb4ba updated getting -started 2017-01-06 04:32:53 -08:00
7fe8dad1f6 0.7.18 2017-01-05 22:39:36 -08:00
858766ea3e Bump pxt-core to 0.8.6 2017-01-05 22:39:34 -08:00
81fe9afbb7 remove begin 2017-01-05 13:35:28 -08:00
65c615f256 Merge branch 'master' into tutorialmode 2017-01-05 13:33:41 -08:00
9c5c699fe7 0.7.17 2017-01-05 13:31:30 -08:00
dcede1703a fixing link 2017-01-05 13:31:05 -08:00
5d33ab019d 0.7.16 2017-01-05 13:30:30 -08:00
f7ec452ea0 updated steps 2017-01-05 13:30:14 -08:00
20260e8933 fixes to docs 2017-01-05 13:28:06 -08:00
d7704934e8 0.7.15 2017-01-05 13:17:24 -08:00
f1eafb0a6e Bump pxt-core to 0.8.5 2017-01-05 13:17:21 -08:00
27d6a8281a Inchworm (#331)
* images for inchworm project

* binding pictures

* updated inchworm lesson
2017-01-05 10:00:36 -08:00
c5128aa497 Merge branch 'master' into tutorialmode 2017-01-05 08:19:39 -08:00
a59394646c fixed docs 2017-01-05 07:37:46 -08:00
6851169dbe 0.7.14 2017-01-05 07:10:13 -08:00
36b3486194 Bump pxt-core to 0.8.3 2017-01-05 07:10:12 -08:00
5d8ccd1d6d adding namespace to api categories (#330)
* adding namespace to api categories

* add icon for led

* adding icons for control, game, images, pins and serial.
2017-01-05 07:01:50 -08:00
c713fe9bf4 0.7.13 2017-01-04 13:08:54 -08:00
f682e5e694 insertAt support for array (#328)
* Adding insertAt and setLength to array

* implemented review comments

* Bump pxt-core to 0.8.2
2017-01-04 13:07:58 -08:00
d2d776fd01 Updating getting started tutorial 2017-01-04 10:06:47 -08:00
641a5e9673 Merge branch 'master' into tutorialmode 2017-01-03 12:14:34 -08:00
93d90a2bde Few extra typing fixes. 2017-01-03 12:14:25 -08:00
a54504f31c Updating bluebird typings path 2017-01-03 11:38:21 -08:00
03111368e0 add more blocks 2017-01-02 22:14:40 -08:00
a973b2aec6 Merge branch 'master' into tutorialmode 2017-01-02 15:10:11 -08:00
a7adf0e6c6 minor ui fixes 2017-01-02 15:09:49 -08:00
c10761128e Tutorial mode changes 2017-01-01 18:52:22 -08:00
9965f169b2 0.7.12 2016-12-31 07:28:12 -08:00
8bf755c15c fixing eddystone uid encoding 2016-12-31 07:25:27 -08:00
d0b2a7db62 0.7.11 2016-12-31 06:49:30 -08:00
780192da3b Bump pxt-core to 0.7.13 2016-12-31 06:49:28 -08:00
07c1f08d18 fix for Microsoft/pxt#1014 2016-12-31 06:36:05 -08:00
25ac847266 converging with other targets on blockly toolbox width 2016-12-31 02:51:24 -08:00
63c8342b86 ui changes accompanying pxt mobile ui fixes 2016-12-31 01:43:45 -08:00
ea2bd7ba10 Merge pull request #326 from Microsoft/array
Array enhancements
2016-12-30 15:09:16 -08:00
cec2d1e8af 0.7.10 2016-12-30 15:05:31 -08:00
1b289b688b Bump pxt-core to 0.7.12 2016-12-30 15:05:28 -08:00
0cf91580cb Merge pull request #327 from Microsoft/pr/toggletheming
Blocks / JS menu toggle theming
2016-12-30 15:00:32 -08:00
392ebc8d07 0.7.9 2016-12-30 14:18:06 -08:00
9068aab12b Bump pxt-core to 0.7.11 2016-12-30 14:18:03 -08:00
85327a4e69 0.7.8 2016-12-30 13:50:03 -08:00
021260b3a4 Bump pxt-core to 0.7.10 2016-12-30 13:50:00 -08:00
4def93d7c5 Blocks / JS menu toggle theming 2016-12-30 13:07:16 -08:00
9aca0c19fc Merge branch 'master' into array 2016-12-23 19:53:06 -08:00
3fcbdbdd82 Array reimplementation as single segment with support for missing values 2016-12-23 19:49:15 -08:00
4b7b6eebca 0.7.7 2016-12-23 08:59:08 -08:00
2da0cf1178 support for buffer signature (#325) 2016-12-23 08:58:38 -08:00
141cb24e3d 0.7.6 2016-12-22 23:18:35 -08:00
35483487af Bump pxt-core to 0.7.9 2016-12-22 23:18:32 -08:00
ec3a805326 0.7.5 2016-12-22 11:35:58 -08:00
780d8bcf8d Bump pxt-core to 0.7.6 2016-12-22 11:35:56 -08:00
f9a12cac64 Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2016-12-22 11:32:01 -08:00
03c2df3277 fixed default projects 2016-12-22 11:31:50 -08:00
a7e98ccb3d Change default product names for Electron app; Add release manifest 2016-12-21 12:31:00 -08:00
1014d2f361 0.7.4 2016-12-20 16:30:14 -08:00
89f20a64d5 Bump pxt-core to 0.7.5 2016-12-20 16:30:12 -08:00
fae36a74af 0.7.3 2016-12-20 13:06:13 -08:00
7e57c59b6f Bump pxt-core to 0.7.4 2016-12-20 13:06:09 -08:00
3141e12f4c support for 8G gestures 2016-12-20 13:05:06 -08:00
4ebe9f595a fix for Microsoft/pxt#961 2016-12-20 12:38:00 -08:00
50f0e85884 docs updates 2016-12-20 12:31:25 -08:00
e28b5d48d4 0.7.2 2016-12-19 16:08:31 -08:00
562e96e09e Bump pxt-core to 0.7.2 2016-12-19 16:08:21 -08:00
6c5088f811 update LESS variables 2016-12-19 16:08:01 -08:00
d5ccb7ad02 0.7.1 2016-12-19 14:11:17 -08:00
ade5176d21 upgraded to 0.7 2016-12-19 14:10:57 -08:00
d2f6d51c19 0.6.46 2016-12-19 14:10:12 -08:00
92b60a251d On start support (#324)
* annotating APIs to support onstart

* missed file

* updated templates

* adding new lines in main.ts

* fixing docs

* removing onstart

* updated docs

* updated various docs

* more docs

* adding upgrade policies for blocks

* updated pxt reference

* placing on start under "basic"
2016-12-19 14:09:35 -08:00
de9f2d7e67 More appropriate Electron app bundle ID on Mac OS 2016-12-19 07:59:52 -08:00
4de5e3bd11 0.6.45 2016-12-18 20:57:52 -08:00
86a33e8f65 Bump pxt-core to 0.6.7 2016-12-18 20:57:50 -08:00
89010b6a8a 0.6.44 2016-12-16 20:26:41 -08:00
48d4668a7a Bump pxt-core to 0.6.6 2016-12-16 20:26:39 -08:00
a2755dc4d2 annotate apis to support multiple forever blocks 2016-12-16 16:47:36 -08:00
52e67c6bfc 0.6.43 2016-12-16 15:29:33 -08:00
5a6f23a7d0 Bump pxt-core to 0.6.5 2016-12-16 15:29:26 -08:00
d1b36f2022 0.6.42 2016-12-16 14:57:24 -08:00
284579181b Bump pxt-core to 0.6.4 2016-12-16 14:57:09 -08:00
167 changed files with 3756 additions and 734 deletions

2
.gitignore vendored
View File

@ -15,7 +15,7 @@ clients/win10/app/bld
clients/win10/*.opendb
clients/**/bin/**
clients/**/obj/**
clients/electron/projects
electron-out
hexcache
*.user

View File

@ -1,6 +1,6 @@
// Place your settings in this file to overwrite default and user settings.
{
"file.autoSave": "afterDelay",
"files.autoSave": "afterDelay",
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/built/**": true,

43
THIRD-PARTY-NOTICES.txt Normal file
View File

@ -0,0 +1,43 @@
/*!----------------- PXT ThirdPartyNotices -------------------------------------------------------
PXT uses third party material from the projects listed below.
The original copyright notice and the license under which Microsoft
received such third party material are set forth below. Microsoft
reserves all other rights not expressly granted, whether by
implication, estoppel or otherwise.
In the event that we accidentally failed to list a required notice, please
bring it to our attention. Post an issue or email us:
abchatra@microsoft.com
---------------------------------------------
Third Party Code Components
---------------------------------------------
Some code derived (as noted) from
https://github.com/bbcmicrobit/micropython
The MIT License (MIT)
Copyright (c) 2013-2016 The MicroPython-on-micro:bit Developers, as listed
in the accompanying AUTHORS file
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -1,5 +1,5 @@
# microbit-chrome
Prototype chrome addon that exposes the micro:bit's serial output to webpages.
Prototype chrome addon that exposes the @boardname@'s serial output to webpages.
* watch the [demo video](https://vimeo.com/146207766)
# Installation

View File

@ -1,4 +1,4 @@
/// <reference path="../node_modules/pxt-core/typings/node/node.d.ts"/>
/// <reference path="../node_modules/pxt-core/typings/globals/node/index.d.ts"/>
/// <reference path="../node_modules/pxt-core/built/pxtlib.d.ts" />
import * as path from "path";

View File

@ -2,6 +2,10 @@
### @description Language constructs for the Block editor.
Blocks snap into each other to define the program that your @boardname@ will run.
Blocks can be event (buttons, shake, ...) or need to be snapped into an event to run.
The [on-start](/blocks/on-start) event runs first.
```namespaces
for (let i = 0;i<5;++i) {}
if (true){}
@ -11,4 +15,4 @@ Math.random(5);
## See Also
[logic](/blocks/logic), [loops](/blocks/loops), [math](/blocks/math), [variables](/blocks/variables)
[logic](/blocks/logic), [loops](/blocks/loops), [math](/blocks/math), [variables](/blocks/variables), [on-start](/blocks/on-start)

View File

@ -86,12 +86,14 @@ if (led.point(1,1) && led.point(2,2)) {
When you compare two Numbers, you get a Boolean value, such as the comparison `x < 5` in the code below:
```blocks
let x = Math.random(5)
if(x < 5) {
basic.showString("low");
} else {
basic.showString("high");
}
input.onButtonPressed(Button.A, () => {
let x = Math.random(5)
if(x < 5) {
basic.showString("low");
} else {
basic.showString("high");
}
})
```
See the documentation on [Numbers](/reference/types/number) for more information on comparing two Numbers. You can also [compare strings](/reference/types/string-functions) using the `equals` function.

View File

@ -14,13 +14,15 @@ Click on the dark blue gear icon (see above) to add an *else* or *if* to the cur
### Example: adjusting screen brightness
```blocks
if(input.lightLevel()<100){
led.setBrightness(255);
}
```
If the [light level](/reference/input/light-level) is `< 100`, this code sets the brightness to `255` when the button A is pressed:
If the [light level](/reference/input/light-level) is `< 100`, this code sets the brightness to `255`:
```blocks
input.onButtonPressed(Button.A, () => {
if(input.lightLevel()<100){
led.setBrightness(255);
}
})
```
### See also

View File

@ -4,14 +4,21 @@
Run part of the program the number of times you say.
```block
for(let i = 0; i <= 4; ++i) {
}
```
### Example: Count to 4
This program will show the numbers 0, 1, 2, 3, and 4 one after another on the LED screen.
```blocks
for(let i = 0; i < 5; ++i) {
basic.showNumber(i)
}
input.onButtonPressed(Button.A, () => {
for(let i = 0; i < 5; ++i) {
basic.showNumber(i)
}
})
```
### See also

View File

@ -2,7 +2,7 @@
Repeat code while a [Boolean](/blocks/logic/boolean) `condition` is true.
```blocks
```block
while(true) {
}
```
@ -16,11 +16,13 @@ The condition is tested before any code runs. Which means that if the condition
The following example uses a while loop to make a diagonal line on the LED screen (points `0, 0`, `1, 1`, `2, 2`, `3, 3`, `4, 4`).
```blocks
let index = 4;
while(index >= 0) {
led.plot(index, index);
index--;
}
input.onButtonPressed(Button.A, () => {
let index = 4;
while(index >= 0) {
led.plot(index, index);
index--;
}
})
```
### See also

28
docs/blocks/on-start.md Normal file
View File

@ -0,0 +1,28 @@
# On Start
An event that runs when the program starts.
The ``on start`` is a special event that runs when the program starts, before any other event.
Use this event to initialize your program.
## Example
In this example, ``on start`` sets a dimmer brightness on the screen and the button handler shows a string.
```blocks
input.onButtonPressed(Button.A, () => {
basic.showString("Hello!")
})
led.setBrightness(50)
```
## What about JavaScript?
``on-start`` only exists in the block editor. In JavaScript, all code executes sequentially from the first line.
## Hey, my events moved!
When we transform the blocks into JavaScript, we always place all the event registrations (buttons, shake, ...)
before launching the ``on start`` code.
If a block from ``on start`` pauses, other registered events will have the opportunity to run as well.

116
docs/device/servo.md Normal file
View File

@ -0,0 +1,116 @@
# Equipping a microservo with Crocodile clips
## Materials
* Cutting pliers or wire cutter
* Tape (masking, duct tape, and/or packing tape)
* 3 crocodile clips, yellow, red and black.
* 1 micro servo 9g (SG90)
## Using a microservo with the @boardname@
The @boardname@ provides just enough current to operate the SG90 microservo.
The servo requires 3 connections: GND, 3V and a logic pin.
In this tutorial, we will equip the servo with crocodile clips to make it easier to use.
However, you could also use a shield or female to crocodile clips to acheive the same effect.
If you are running a class or activity, you should consider preparing all servos before hand.
### ~ hint
Kitronik wrote an excellent in-depth guide about using servos with the @boardname@.
Check it out at https://www.kitronik.co.uk/blog/using-bbc-microbit-control-servo/ .
### ~
## Step 1: cutout the connector
Using the cutting pliers, cut out the dark plastic connector.
![](/static/mb/projects/inchworm/servo1.jpg)
## Step 2: strip out cables
Using the plier or a wire stripper, strip the plastic from the cables.
![](/static/mb/projects/inchworm/servotrim.jpg)
## Step 3: threading the servo cablers
Thread the servo cables.
![](/static/mb/projects/inchworm/servo3.jpg)
## Step 4: crocobile clip claps
Cut a crocodile cable in two and strip out the casing.
If possible try to use the same cable colors as the servo!
![](/static/mb/projects/inchworm/servo4.jpg)
## Step 5: thread cables together
Place the cables next to each other
![](/static/mb/projects/inchworm/servo5.jpg)
... and thread them together.
![](/static/mb/projects/inchworm/servo6.jpg)
### ~ hint
It is very **important** to ensure that there is a good connection between the 2 cables.
If the connection is weak, the microservo will not receive enough current and it will not work.
**If you have access to a soldering iron, we strongly recommend to solder this connection.**
### ~
## Step 4: protect the connection
Protect the connection with electrical or duct tape.
![](/static/mb/projects/inchworm/servo7.jpg)
## Step 5: repeat for all cables
Repeat the same process until all cables are connected.
![](/static/mb/projects/inchworm/servo8.jpg)
## Step 6: testing!
It's time to test that your connection are all proper and that the servo will function **when the @boardname@ is powered by battery**.
* Connect the microservo to the @boardname@. Black cable on ``GND``, red cable on ``3V`` and remaining cable on ``P0``.
![](/static/mb/projects/inchworm/circuit1.jpg)
### ~ hint
When attaching the crocodile clips to the pins, don't hesitate to grab the side of the board with the jaws.
![](/static/mb/projects/inchworm/circuit2.jpg)
### ~
* Download the following code to your @boardname@
```blocks
basic.forever(() => {
pins.servoWritePin(AnalogPin.P0, pins.map(
input.acceleration(Dimension.X),
-512,
512,
0,
180
))
})
```
* When powered by USB, make sure that the servo moves when you tilt the board.
* When powered by batteries **only**, make sure that the servo moves when you tilt the board.
## Troubleshooting
If your servo seems to sutter and stay stuck at a particular position, it means that it is not receiving enough power.
This is probably due to a weak connection or low battery level. Check each connection and check your batteries.

View File

@ -6,6 +6,7 @@
* **[Getting Started](/getting-started)**
* [Projects](/projects)
* [Examples](/examples)
* [Lessons](/lessons)
### @boardname@ reference

35
docs/examples.md Normal file
View File

@ -0,0 +1,35 @@
# Examples
Here are some fun programs for your @boardname@!
## Fun stuff
```codecard
[{
"name": "Blinky",
"url":"/examples/blinky"
},
{
"name": "Name Tag",
"url":"/examples/name-tag"
},
{
"name": "Rando",
"url":"/examples/rando"
}]
```
## Sensors
```codecard
[{
"name": "Plot Acceleration",
"url":"/examples/plot-acceleration"
}, {
"name": "Plot Light Level",
"url":"/examples/plot-light-level"
}, {
"name": "Plot Analog Pin",
"url":"/examples/plot-analog-pin"
}]
```

20
docs/examples/blinky.md Normal file
View File

@ -0,0 +1,20 @@
# Blinky
```blocks
basic.forever(() => {
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`
);
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .`
);
})
```

View File

@ -0,0 +1,7 @@
# Name Tag
```blocks
basic.forever(() => {
basic.showString("JAMES")
})
```

View File

@ -0,0 +1,10 @@
# Plot Acceleration
```blocks
basic.forever(() => {
led.plotBarGraph(
input.acceleration(Dimension.X),
1023
)
})
```

View File

@ -0,0 +1,10 @@
# Plot Analog Pin
```blocks
basic.forever(() => {
led.plotBarGraph(
pins.analogReadPin(AnalogPin.P0),
1023
)
})
```

View File

@ -0,0 +1,10 @@
# Plot Light level
```blocks
basic.forever(() => {
led.plotBarGraph(
input.lightLevel(),
255
)
})
```

7
docs/examples/rando.md Normal file
View File

@ -0,0 +1,7 @@
# Rando
```blocks
basic.forever(() => {
led.toggle(Math.random(5), Math.random(5))
})
```

View File

@ -33,7 +33,7 @@ basic.forever(() => {
When this program runs, you will see a smiley face, then a blank
screen, then a smiley again -- it never stops! (That's because of the
``forever`` block.)
`[basic.forever(() => {})]` block.)
Click **Download** to move your program to the @boardname@!
Make sure to follow the instructions.

View File

@ -17,7 +17,7 @@ input.onButtonPressed(Button.A, () => {
#### ~hint
The ``showString`` block can show letters, numbers, and punctuation
The `[basic.showString("HI")]` block can show letters, numbers, and punctuation
on the @boardname@ screen.
#### ~
@ -33,7 +33,7 @@ input.onButtonPressed(Button.B, () => {
#### ~hint
You can find the letter `B` by clicking the letter `A` on the
``onButtonPressed`` block.
`[input.onButtonPressed(Button.A, () => {})]` block.
#### ~

View File

@ -23,8 +23,8 @@ input.onButtonPressed(Button.B, () => {
```
### ~hint
The ``pick random true or false`` block randomly tells the ``if``
block `true` or `false`. If the ``pick`` block picked `true`, the
The `[Math.randomBoolean()]` block randomly tells the ``if``
block `true` or `false`. If value picked is `true`, the
``if`` block shows the letter `H`. Otherwise, it shows the letter `T`.
That's it!

View File

@ -9,7 +9,7 @@ There are 25 bright LEDs on the @boardname@ screen. Let's use them to create som
### Happy unhappy face
Draw an unhappy face instead of the blank screen. Click on the dots
in the second ``show leds`` block until it matches the blocks below.
in the second `[basic.showLeds("")]` block until it matches the blocks below.
Now you have an **animation** (cartoon) that shows a happy face,
then an unhappy one, then a happy one again, forever (or until
you turn off your @boardname@)!
@ -36,7 +36,7 @@ Click **Download** to move your program to the @boardname@!
### Your turn!
Pile up more ``show leds`` blocks to create an animation! Create an
Pile up more `[basic.showLeds("")]` blocks to create an animation! Create an
animation with at least 5 pictures. What does this animation show?
```blocks
@ -87,12 +87,6 @@ basic.forever(() => {
```
Click **Download** to move your program to the @boardname@!
#### ~hint
You can find the ``show leds`` block in the **Basic** part of the editor.
#### ~
### ~button /getting-started/buttons
NEXT: BUTTONS
### ~

View File

@ -1,3 +1,3 @@
{
"appref": "v0.6.36"
"appref": "v0.9.11"
}

View File

@ -3,27 +3,48 @@
You can publish libraries (also known as packages or extensions)
that users can then add to their scripts. These typically
provide a driver for a particular hardware device you can connect
to a microbit.
to a microbit.
### ~ hint
All packages need to be approved by the Micro:bit Foundation before being available in the web editor.
See **Approval** section below.
### ~
* [pxt-max6675](https://github.com/Microsoft/pxt-max6675) -- TypeScript
* [pxt-neopixel](https://github.com/Microsoft/pxt-neopixel) -- TypeScript + ARM Thumb assembly package
* [pxt-max6675](https://github.com/Microsoft/pxt-max6675) -- TypeScript
* [pxt-sonar](https://github.com/microsoft/pxt-sonar) -- TypeScript
* [pxt-i2c-fram](https://github.com/microsoft/pxt-i2c-fram) -- TypeScript
* [Sample C++ extension](https://github.com/Microsoft/pxt-microbit-cppsample)
* [Sample TypeScript extension](https://github.com/Microsoft/pxt-microbit/tree/master/libs/i2c-fram)
## Finding packages
From the editor, the user clicks on **More** then **Add Package** and searches for the package.
From the block editor, the user clicks on **Add Package** and searches for the package.
Otherwise, the **Add Package** is also available from the gearwheel menu.
To see the list of packages, click on **More** then **Show Files** to see the project file list.
To see the list of packages, switch to JavaScript and use the **Explorer** view to find them.
To remove a package, click on the garbage button in the file list next to the package.
To remove a package, click on the garbage button in the **Explorer** view next to the package.
## Publishing packages
## Publishing and Approving packages
Packages can be published from the pxt command line. Check out [the docs](https://www.pxt.io/packages).
Once your package is ready, follow these steps to get it approved and listed in the pxt.microbit.org web site:
1. setup a public GitHub repository with your package sources
2. ensure that the license is **Apache2** or **MIT**
3. fill ``test.ts`` with a test scenario
4. ensure that the package builds by running ``pxt`` from the package folder. [Read more...](https://www.pxt.io/packages).
5. fill up the ``README.md`` file with documentation. See [markdown docs](https://pxt.io/writing-docs) for syntax.
6. publish a release by running ``pxt bump`` from the package folder.
7. open a support ticket at https://support.microbit.org, add **package approval** in the subject line.
```
Package approval request
github repo: .....
```
## Localizing packages

View File

@ -62,13 +62,13 @@ Fun games to build with your @boardname@.
}]
```
## Science and Engineering
## Toys
```codecard
[{
"name": "Timing gates",
"url":"/projects/timing-gates",
"imageUrl":"/static/mb/projects/timing-gates.jpg"
"name": "Inchworm",
"url":"/projects/inchworm",
"imageUrl":"/static/mb/projects/inchworm.jpg"
}]
```
@ -76,6 +76,10 @@ Fun games to build with your @boardname@.
```codecard
[{
"name": "Timing gates",
"url":"/projects/timing-gates",
"imageUrl":"/static/mb/projects/timing-gates.jpg"
}, {
"name": "Compass",
"url":"/projects/compass",
"imageUrl":"/static/mb/projects/a5-compass.png"
@ -92,4 +96,4 @@ Fun games to build with your @boardname@.
### 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), [Wallet](/projects/wallet), [Watch](/projects/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), [Wallet](/projects/wallet), [Watch](/projects/watch)

View File

@ -21,8 +21,8 @@ Build your own @boardname@ piano using bananas!
## Activities
* [Making the keyboard](/projects/banana-keyboard/make)
* [Beat box](/projects/banana-keyboard/beat-box)
* [Make](/projects/banana-keyboard/make)
* [Code](/projects/banana-keyboard/code)
### ~button /projects/banana-keyboard/make
Let's get started!

View File

@ -1,4 +1,4 @@
# banana keyboard - beat box
# Code
Have you ever tried to making beat box sounds? Let's try making a beatbox with code!

View File

@ -1,4 +1,4 @@
# banana keyboard - making
# Make
## Materials
@ -80,6 +80,6 @@ input.onPinPressed(TouchPin.P1, () => {
Tap your banana instrument to play sound against... the fruit!
### ~button /projects/banana-keyboard/beat-box
### ~button /projects/banana-keyboard/code
NEXT: beat box
### ~

View File

@ -0,0 +1,43 @@
# Coffee Cup Monster
### @description A monster made of cardboard that responds to light
### ~avatar avatar
Make a coffee cup monster that responds to light!
### ~
https://youtu.be/BiZLjugXMbM
## Duration
3 Activities, approx 30-45 min each based on familiarity with the coding concepts
## Materials
* 3 Coffee cup holders
* 2 Coffee cup strirer wood sticks
* Glue gun
* Scissors that can cut cardboard
* 1 @boardname@, battery holder and 2 AAA batteries
* 3 Crocodile clips
* 1 micro servo 9g SG90
* 1 paper clip
## Preparation
* [Equip the microservo with crocodile clips](/device/servo)
## Activities
* [Make](/projects/coffee-cup-monster/make)
* [Code](/projects/coffee-cup-monster/code)
* [Connect](/projects/coffee-cup-monster/connect)
### ~button /projects/coffee-cup-monster/make
Let's get started!
### ~

View File

@ -0,0 +1,29 @@
# Code
### @description code to make the coffee cup monster alive
### ~avatar avatar
Add code to open the mouth when light is detected.
### ~
## Duration: ~30 minutes
We are going to add code to open the mouth proportionally to the amount of light on the @boardname@.
In a loop, we will read the light and map it to an angle using the ``pins.map`` function.
```blocks
basic.forever(() => {
pins.servoWritePin(AnalogPin.P0, pins.map(
input.lightLevel(),
0,
255,
30,
150
))
})
```
### ~button /projects/coffee-cup-monster/connect
NEXT: Connect
### ~

View File

@ -0,0 +1,29 @@
# Connect
### ~avatar avatar
Remote control your monster with another @boardname@
### ~
## Duration: ~30 minutes
You will need 2 @boardname@ for this part. By using the radio, we can make the inchworm controlled by another @boardname@.
Download the code below to the @boardname@ on the inchworm and another "controller" @boardname@.
Whenere A is pressed, the monster will open and close it's mouth will move once.
```blocks
radio.onDataPacketReceived(({receivedNumber}) => {
pins.servoWritePin(AnalogPin.P0, 30)
basic.pause(500)
pins.servoWritePin(AnalogPin.P0, 150)
basic.pause(500)
})
input.onButtonPressed(Button.A, () => {
radio.sendNumber(0)
})
```
```package
radio
```

View File

@ -0,0 +1,25 @@
# Make
### @description Building the coffee cup monster
### ~avatar avatar
Turn a piece of coffee holders into a monster!
### ~
## Duration: ~60 minutes
## Materials
* 3 Coffee cup holders
* 2 Coffee cup strirer wood sticks
* Scissors
* glue gun or tape
* 1 paper clip
## Step 1: cardboard
TODO
### ~button /projects/coffee-cup-monster/code
NEXT: Code
### ~

View File

@ -21,7 +21,7 @@ Use pin press to switch guitar play on/off
## Blocks
```cards
var on = false
let on = false
on;
if (on) { } else {}
input.onPinPressed(TouchPin.P1, () => {})
@ -106,7 +106,7 @@ input.onPinPressed(TouchPin.P1, () => {
*Final code*
TODO: do we want to use `on = !on;` or be more direct in flipping the switch? `on = true; on = false;`
```blocks
var on = false
let on = false
basic.forever(() => {
if (on) {
music.setTempo(pins.map(Math.abs(input.acceleration(Dimension.Y)),

View File

@ -27,8 +27,8 @@ Build your own music player @boardname@ from headphones.
## Activities
* [Connect your headphone](/projects/hack-your-headphones/make)
* [Play sounds!]()
* [Make](/projects/hack-your-headphones/make)
* [Code](/projects/hack-your-headphones/code)
### ~button /projects/hack-your-headphones/make

View File

@ -1,4 +1,4 @@
# hack your headphones - music of light
# Code
### ~avatar avatar
@ -10,7 +10,9 @@ Let's start by adding a variable where you can store data. Then rename the varia
```blocks
let light = input.lightLevel();
input.onButtonPressed(Button.A, () => {
let light = input.lightLevel();
});
```
We want to play music on button pressed in order to register an event handler that will execute whenever when you run a script and click on button pressed on the simulator. We must start by opening the Input drawer and adding `on button pressed` A. Then add a block `rest` to plays nothing for a `1/16` beat. Modify your code so that your code looks like this.

View File

@ -1,4 +1,4 @@
# hack your headphones - making
# Make
### ~avatar avatar
@ -46,7 +46,7 @@ Using the 2nd crocodile clip, connect the second end of the crocodile clip onto
You hacked your headphones!
### ~button /projects/hack-your-headphones/music-of-light
### ~button /projects/hack-your-headphones/code
NEXT: music of light

44
docs/projects/inchworm.md Normal file
View File

@ -0,0 +1,44 @@
# Inchworm
### @description A inchworm like robot built with the @boardname@
### ~avatar avatar
Make a funny inchworm robot!
### ~
https://youtu.be/BiZLjugXMbM
## Duration
3 Activities, approx 30-45 min each based on familiarity with the coding concepts
## Materials
* Cardboard pieces (recycle!)
* Glue gun or Tape (masking, duct tape, and/or packing tape)
* Scissors that can cut cardboard
* 1 @boardname@, battery holder and 2 AAA batteries
* 3 Crocodile clips
* 1 micro servo 9g SG90
* 1 paper clip
![Materials](/static/mb/projects/inchworm/materials.jpg)
## Preparation
* [Equip the microservo with crocodile clips](/device/servo)
## Activities
* [Make](/projects/inchworm/make)
* [Code](/projects/inchworm/code)
* [Connect](/projects/inchworm/connect)
### ~button /projects/inchworm/make
Let's get started!
### ~

View File

@ -0,0 +1,35 @@
# Code
### @description code to make the inchworm alive
### ~avatar avatar
Add code to make the inchworm move.
### ~
## Duration: ~30 minutes
## Step 1: walk forever
In order for the inchworm to move, the @boardname@ needs to command the servo to go between ``0`` and ``180`` degrees
at a certain pace. In the code below, the user pressed button ``A`` to launch the inchworm.
```blocks
input.onButtonPressed(Button.A, () => {
pins.servoWritePin(AnalogPin.P0, 0);
basic.pause(500);
pins.servoWritePin(AnalogPin.P0, 180);
basic.pause(500);
});
```
### ~ hint
You may have noticed that the inchworm can be rather slow or simply won't move. Try to improve the design of your legs, teeth
so that the inchworm goes as fast as possible. Trying it on carpet also great helps avoiding skidding.
### ~
### ~button /projects/inchworm/connect
NEXT: Connect
### ~

View File

@ -0,0 +1,28 @@
# Connect
### ~avatar avatar
Remote control your inchworm with another @boardname@
### ~
## Duration: ~30 minutes
You will need 2 @boardname@ for this part. By using the radio, we can make the inchworm controlled by another @boardname@.
Download the code below to the @boardname@ on the inchworm and another "controller" @boardname@. Whenere A is pressed, the inchworm will move once.
```blocks
radio.onDataPacketReceived(({receivedNumber}) => {
pins.servoWritePin(AnalogPin.P0, 0)
basic.pause(500)
pins.servoWritePin(AnalogPin.P0, 180)
basic.pause(500)
})
input.onButtonPressed(Button.A, () => {
radio.sendNumber(0)
})
```
```package
radio
```

View File

@ -0,0 +1,88 @@
# Make
### @description Building the cardboard inchworm
### ~avatar avatar
Turn a piece of cardboard into an inchworm!
### ~
## Duration: ~45 minutes
## Materials
* Cardboard
* Scissors or cutters
* glue gun or tape
* 1 paper clip
## Step 1: cardboard
Cutout a cardboard rectangle. You can use the @boardname@ as a ruler to figure out the size.
![](/static/mb/projects/inchworm/chassis1.jpg)
## Step 2: center fold
Fold the cardboard in half over the short edge.
![](/static/mb/projects/inchworm/chassis2.jpg)
## Step 3: legs
Fold each end so they rest flat on the ground.
![](/static/mb/projects/inchworm/chassis3.jpg)
## Step 4: front teeth
Fold each corners on one end of the cardbard. This will be the front of the inchworm which is supposed to grip the ground.
![](/static/mb/projects/inchworm/chassis4.jpg)
## Step 5: back teeth
Using a scissor or a cutter (watch the fingers!), cut out various strips in the other edge. Fold one after the other.
![](/static/mb/projects/inchworm/chassis5.jpg)
## Step 6: mounting the board
Using tape or a glue gun, mount the @boardname@ on one side and the microservo on the cardobard.
![](/static/mb/projects/inchworm/chassis6.jpg)
## Step 7: mounting the servo
Attach the servo on the **edge** of the other cardboard side.
![](/static/mb/projects/inchworm/chassis7.jpg)
## Step 8: Cable clean up (optional)
Use tape to route the cables nicely on the inchworm.
![](/static/mb/projects/inchworm/chassis8.jpg)
## Step 9: attaching paper clip to servo
Unfold a paper clip and attach it to the servo arm.
![](/static/mb/projects/inchworm/clip2.jpg)
## Step 10: attaching paper clip to cardboard
Slide the folder paper clip into the cardboard, and use tape to secure it.
You might need to toy around with the size of the clip so that the servo rotation opens the inchworm sufficiently.
![](/static/mb/projects/inchworm/clip3.jpg)
## Step 11: it's ready!
Your inchworm is ready!
![](/static/mb/projects/inchworm/ready.jpg)
### ~button /projects/inchworm/code
NEXT: Code
### ~

View File

@ -37,7 +37,7 @@ input.onButtonPressed(Button.B, () => {
We will use the @boardname@'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 @boardname@ 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
```block
input.magneticForce(Dimension.Strength)
```
@ -50,16 +50,19 @@ If you have ever played with magnets you know they have two ends, often called a
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
let force = Math.abs(input.magneticForce(Dimension.Strength));
let isSwitched = force > 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 @boardname@. We should also make sure 'isSwitched' is false when our program starts.
```blocks
let force = 0;
let isSwitched = false;
basic.forever(() => {
let isSwitched = Math.abs(input.magneticForce(Dimension.Strength)) > 100
force = Math.abs(input.magneticForce(Dimension.Strength));
isSwitched = force > 100
})
```
@ -68,10 +71,11 @@ basic.forever(() => {
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 force = 0;
let isSwitched = false;
basic.forever(() => {
isSwitched = Math.abs(input.magneticForce(Dimension.Strength)) > 100
force = Math.abs(input.magneticForce(Dimension.Strength));
isSwitched = force > 100
})
input.onButtonPressed(Button.A, () => {

View File

@ -17,8 +17,8 @@ Build a telegraph between two @boardname@s to communicate with your friends!
## Activities
* [Making the circuit](/projects/telegraph/make)
* [Manual telegraph](/projects/telegraph/manual-telegraph)
* [Make](/projects/telegraph/make)
* [Code](/projects/telegraph/code)
### ~button /projects/telegraph/make
Let's get started!

View File

@ -1,4 +1,4 @@
# telegraph - manual telegraph
# Code
Let's build the code that will send a impulse while the user presses ``A``.

View File

@ -1,4 +1,4 @@
# telegraph - making
# Make
### ~avatar
@ -68,8 +68,8 @@ Using the 4th crocodile clip, connect the unattached end of the crocodile clip o
![](/static/mb/lessons/telegraph-0.png)
### ~button /projects/telegraph/manual-telegraph
### ~button /projects/telegraph/code
NEXT: manual telegraph
NEXT: Code
### ~

View File

@ -1,4 +1,4 @@
# Wallet - Code
# Code
## Simple animation

View File

@ -1,4 +1,4 @@
# Wallet - Make
# Make
### @description Maker Project for Wallet

View File

@ -18,15 +18,15 @@ and updates the screen with the direction.
basic.forever(() => {
let heading = input.compassHeading()
if (heading < 45) {
basic.showString("N", 100)
basic.showString("N")
} else if (heading < 135) {
basic.showString("E", 100)
basic.showString("E")
}
else if (heading < 225) {
basic.showString("S", 100)
basic.showString("S")
}
else {
basic.showString("W", 100)
basic.showString("W")
}
})
```
@ -40,7 +40,7 @@ You can use a program like this to count things with your @boardname@.
```blocks
let num = 0
basic.forever(() => {
basic.showNumber(num, 150)
basic.showNumber(num)
})
input.onButtonPressed(Button.A, () => {
num = num + 1
@ -56,10 +56,10 @@ Try this on your @boardname@:
```blocks
basic.forever(() => {
basic.showNumber(6789, 150)
basic.showNumber(6789)
})
input.onButtonPressed(Button.A, () => {
basic.showNumber(2, 150)
basic.showNumber(2)
})
```

View File

@ -35,7 +35,8 @@ bluetooth.uartWriteValue("", 0);
## Eddystone
```cards
bluetooth.advertiseUrl("https://pxt.microbit.org/", 7);
bluetooth.advertiseUid(42, 1, 7, true);
bluetooth.advertiseUrl("https://pxt.microbit.org/", 7, true);
bluetooth.stopAdvertising();
```

View File

@ -0,0 +1,37 @@
# Avertise UID Buffer
Advertises a UID via the Eddystone protocol over Bluetooth.
## ~hint
### Eddystone
Bluetooth beacons are used to indicate proximity to a place or object of interest.
Beacons use Bluetooth advertising to broadcast a small amount of data,
which can be received and acted upon by anyone in range with a suitable device and software, typically a smartphone and application.
There are various beacon message formats, which define the way Bluetooth advertising packets are used as containers for beacon data.
iBeacon is Apple's beacon message format. Eddystone comes from Google.
Read more at https://lancaster-university.github.io/microbit-docs/ble/eddystone/ .
## ~
```sig
bluetooth.advertiseUidBuffer(pins.createBuffer(16), 7, true);
```
### Parameters
* ``buffer`` - a 16 bytes buffer containing the namespace (first 10 bytes) and instance (last 6 bytes).
* ``power`` - a [number](/reference/types/number) representing the power level between 0 (short) and 7 (maximum range).
* ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections.
## See Also
[stop-advertising](/reference/bluetooth/stop-advertising), [advertise-uid](/reference/bluetooth/advertise-uid)
```package
bluetooth
```

View File

@ -0,0 +1,46 @@
# Avertise UID
Advertises a UID via the Eddystone protocol over Bluetooth.
## ~hint
### Eddystone
Bluetooth beacons are used to indicate proximity to a place or object of interest.
Beacons use Bluetooth advertising to broadcast a small amount of data,
which can be received and acted upon by anyone in range with a suitable device and software, typically a smartphone and application.
There are various beacon message formats, which define the way Bluetooth advertising packets are used as containers for beacon data.
iBeacon is Apple's beacon message format. Eddystone comes from Google.
Read more at https://lancaster-university.github.io/microbit-docs/ble/eddystone/ .
## ~
```sig
bluetooth.advertiseUid(42, 1, 7, true);
```
### Parameters
* ``namespace`` last 4 bytes of the namespace uid (6 to 9)
* ``instance`` last 4 bytes of the instance (2 to 5)
* ``power`` - a [number](/reference/types/number) representing the power level between 0 (short) and 7 (maximum range).
* ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections.
## Encoding
The bytes of ``namespace`` and ``instance`` are encoded to generate the 10 bytes UID namespace and 6 bytes UID instance.
```
UID namespace: [0, ..., namespace]
UID instance: [0, ..., instance]
```
## See Also
[stop-advertising](/reference/bluetooth/stop-advertising), [advertise-uid-buffer](/reference/bluetooth/advertise-uid-buffer)
```package
bluetooth
```

View File

@ -25,6 +25,7 @@ bluetooth.advertiseUrl("https://pxt.microbit.org/", 7, true);
* ``url`` - a [string](/reference/types/string) containing the URL to broadcast, at most 17 characters long, excluding the protocol (eg: ``https://``) which gets encoded as 1 byte.
* ``power`` - a [number](/reference/types/number) representing the power level between 0 (short) and 7 (maximum range).
* ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections.
### Example: Broadcast a secret code
@ -34,7 +35,7 @@ bluetooth.advertiseUrl("https://pxt.io?secret=42", 7, true);
## See Also
[stop-advertising](/reference/bluetooth/stop-advertising)
[stop-advertising](/reference/bluetooth/stop-advertising), [advertise-uid](/reference/bluetooth/advertise-uid)
```package
bluetooth

View File

@ -0,0 +1,30 @@
# Set Events
Configure the type of events emitted by a given pin.
```sig
pins.setEvents(DigitalPin.P0, PinEventType.Edge);
```
### Parameters
* ``name``: The @boardname@ hardware pin to configure (``P0`` through ``P20``)
* ``type``: The type of events this pin should emit
### Example
The following example configures pin ``P0`` and then
subscribes to the rise and fall events.
```blocks
control.onEvent(control.eventSourceId(EventBusSource.MICROBIT_ID_IO_P0), control.eventValueId(EventBusValue.MICROBIT_PIN_EVT_RISE), () => {
basic.showString("Rise")
})
control.onEvent(control.eventSourceId(EventBusSource.MICROBIT_ID_IO_P0), control.eventValueId(EventBusValue.MICROBIT_PIN_EVT_FALL), () => {
basic.showString("Fall")
})
pins.setEvents(DigitalPin.P0, PinEventType.Edge)
```
**This is an advanced API.** For more information, see the
[@boardname@ runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/)

View File

@ -21,7 +21,7 @@ To add or remove the parts of the packet from the block, try clicking the blue g
* `receivedString` - The [string](/reference/types/string) that was sent in this packet or the empty string if this packet did not contain a string. See [send string](/reference/radio/send-string) and [send value](/reference/radio/send-value)
* `time` - The system time of the @boardname@ that sent this packet at the time the packet was sent.
* `serial` - The serial number of the @boardname@ that sent this packet or `0` if the @boardname@ did not include its serial number.
* `signal` - How strong the radio signal is from `255` (weak) to `0` (strong).
* `signal` - How strong the radio signal is from `-128` (weak) to `-42` (strong).
### Example
@ -39,6 +39,23 @@ radio.onDataPacketReceived(({ receivedNumber }) => {
})
```
### Example
This program uses the signal strength from received packets to graph the
approximate distance between two @boardname@s.
```blocks
basic.forever(() => {
radio.sendNumber(0)
})
radio.onDataPacketReceived(({ signal, receivedNumber }) => {
led.plotBarGraph(
Math.abs(signal + 42),
128 - 42
)
})
```
### See also
[send number](/reference/radio/send-number),

View File

@ -2,8 +2,8 @@
> Note: This API has been deprecated! Use [on data packet received](/reference/radio/on-data-packet-received) instead.
Find how strong the ``radio`` signal is, from `255` to `0`.
(`255` means a weak signal and `0` means a strong one.)
Find how strong the ``radio`` signal is, from `-128` to `-42`.
(`-128` means a weak signal and `-42` means a strong one.)
The @boardname@ finds the signal strength by checking how strong it was
the last time it ran the
@ -16,7 +16,7 @@ radio.receivedSignalStrength();
### Returns
* a [number](/reference/types/number) between `255` and `0` that means
* a [number](/reference/types/number) between `-128` and `-42` that means
how strong the signal is.
### Simulator

View File

@ -7,8 +7,11 @@ serial.writeLine("");
serial.writeNumber(0);
serial.writeValue("x", 0);
serial.writeString("");
serial.readUntil(",");
serial.readLine();
serial.readString();
serial.redirect(SerialPin.P0, SerialPin.P0, BaudRate.BaudRate115200);
serial.onDataReceived(",", () => {})
```
### See Also

View File

@ -0,0 +1,29 @@
# Serial On Data Received
Registers an event to be fired when one of the delimiter is matched.
```sig
serial.onDataReceived(",", () => {})
```
### Parameters
* `delimiters` is a [string](/reference/types/string) containing any of the character to match
### Example
Read values separated by `,`:
```blocks
serial.onDataReceived(serial.delimiters(Delimiters.Comma), () => {
basic.showString(serial.readUntil(serial.delimiters(Delimiters.Comma)))
})
```
### See also
[serial](/device/serial),
[serial write line](/reference/serial/write-line),
[serial write value](/reference/serial/write-value)

View File

@ -0,0 +1,27 @@
# Serial Read String
Read the buffered serial data as a string
```sig
serial.readString();
```
### Returns
* a [string](/reference/types/string) containing input from the serial port. Empty if no data available.
### Example
The following program scrolls text on the screen as it arrives from serial.
```blocks
basic.forever(() => {
basic.showString(serial.readString());
});
```
### See also
[serial](/device/serial),
[serial write line](/reference/serial/write-line),
[serial write value](/reference/serial/write-value)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

61
docs/static/avatar.svg vendored Normal file
View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
role="img"
aria-labelledby="title desc"
xml:space="preserve"
enable-background="new 0 0 280 32.755"
height="52.672001"
width="52.672001"
version="1.1"
id="svg2"
inkscape:version="0.91 r13725"
sodipodi:docname="logo.square.black.svg"><sodipodi:namedview
pagecolor="#ff00ff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1536"
inkscape:window-height="801"
id="namedview14"
showgrid="false"
inkscape:zoom="2.0836233"
inkscape:cx="83.390493"
inkscape:cy="16.071144"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" /><rect
id="backgroundrect"
width="195.47368"
height="34.210526"
x="0"
y="18.461473"
class=""
style="fill:none;stroke:none" /><title
id="title"
lang="en-GB">BBC micro:bit</title><desc
id="desc"
lang="en-GB">BBC micro:bit logo</desc><metadata
id="metadata37"><rdf:rdf><cc:work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:work></rdf:rdf><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>BBC micro:bit</dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs35" /><path
inkscape:connector-curvature="0"
class=""
d="m 37.363,29.377 c -1.677,0 -3.035,-1.364 -3.035,-3.042 0,-1.678 1.357,-3.038 3.035,-3.038 1.684,0 3.039,1.36 3.039,3.038 0,1.678 -1.355,3.042 -3.039,3.042 M 15.052,23.3 c -1.677,0 -3.042,1.357 -3.042,3.035 0,1.678 1.363,3.042 3.042,3.042 1.674,0 3.036,-1.364 3.036,-3.042 0,-1.678 -1.363,-3.035 -3.036,-3.035 m -0.003,-5.99 22.576,0 c 4.979,0 9.027,4.047 9.027,9.027 0,4.979 -4.049,9.031 -9.027,9.031 l -22.576,0 c -4.977,0 -9.0299993,-4.053 -9.0299993,-9.031 C 6.0180007,21.357 10.072,17.31 15.049,17.31 m 22.576,24.076 c 8.299,0 15.047,-6.75 15.047,-15.049 0,-8.299 -6.748,-15.051 -15.047,-15.051 l -22.576,0 C 6.7500007,11.286 6.9250488e-7,18.038 6.9250488e-7,26.337 6.9250488e-7,34.636 6.7500007,41.386 15.049,41.386 l 22.576,0"
id="path21"
style="fill:#000000"
sodipodi:nodetypes="csssccsssccsssscccsssssc" /></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
docs/static/blocks/iconnames/heart.PNG vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

61
docs/static/loader.svg vendored Normal file
View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
role="img"
aria-labelledby="title desc"
xml:space="preserve"
enable-background="new 0 0 280 32.755"
height="52.672001"
width="52.672001"
version="1.1"
id="svg2"
inkscape:version="0.91 r13725"
sodipodi:docname="logo.square.white.svg"><sodipodi:namedview
pagecolor="#ff00ff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1536"
inkscape:window-height="801"
id="namedview14"
showgrid="false"
inkscape:zoom="2.0836233"
inkscape:cx="83.390493"
inkscape:cy="16.071144"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" /><rect
id="backgroundrect"
width="195.47368"
height="34.210526"
x="0"
y="18.461473"
class=""
style="fill:none;stroke:none" /><title
id="title"
lang="en-GB">BBC micro:bit</title><desc
id="desc"
lang="en-GB">BBC micro:bit logo</desc><metadata
id="metadata37"><rdf:rdf><cc:work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:work></rdf:rdf><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>BBC micro:bit</dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs35" /><path
inkscape:connector-curvature="0"
class=""
d="m 37.363,29.377 c -1.677,0 -3.035,-1.364 -3.035,-3.042 0,-1.678 1.357,-3.038 3.035,-3.038 1.684,0 3.039,1.36 3.039,3.038 0,1.678 -1.355,3.042 -3.039,3.042 M 15.052,23.3 c -1.677,0 -3.042,1.357 -3.042,3.035 0,1.678 1.363,3.042 3.042,3.042 1.674,0 3.036,-1.364 3.036,-3.042 0,-1.678 -1.363,-3.035 -3.036,-3.035 m -0.003,-5.99 22.576,0 c 4.979,0 9.027,4.047 9.027,9.027 0,4.979 -4.049,9.031 -9.027,9.031 l -22.576,0 c -4.977,0 -9.0299993,-4.053 -9.0299993,-9.031 C 6.0180007,21.357 10.072,17.31 15.049,17.31 m 22.576,24.076 c 8.299,0 15.047,-6.75 15.047,-15.049 0,-8.299 -6.748,-15.051 -15.047,-15.051 l -22.576,0 C 6.7500007,11.286 6.9250488e-7,18.038 6.9250488e-7,26.337 6.9250488e-7,34.636 6.7500007,41.386 15.049,41.386 l 22.576,0"
id="path21"
style="fill:#ffffff"
sodipodi:nodetypes="csssccsssccsssscccsssssc" /></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -11,8 +11,7 @@
aria-labelledby="title desc"
xml:space="preserve"
enable-background="new 0 0 280 32.755"
height="52.672001"
width="52.672001"
viewBox="0 0 52.672001 52.672001"
version="1.1"
id="svg2"
inkscape:version="0.91 r13725"

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -11,8 +11,7 @@
aria-labelledby="title desc"
xml:space="preserve"
enable-background="new 0 0 280 32.755"
height="52.672001"
width="52.672001"
viewBox="0 0 52.672001 52.672001"
version="1.1"
id="svg2"
inkscape:version="0.91 r13725"

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
docs/static/mb/projects/inchworm.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1,74 @@
# Getting started
### Step 1
Place blocks in the workspace to scroll text on the screen.
```blocks
basic.showString("Hello!")
```
### Step 2
Click ``|Download|`` to transfer your code in your @boardname@!
### Step 3
Great, the text scrolled! But then it stopped.
Let's make it scroll when button **A** is pressed.
```block
input.onButtonPressed(Button.A, () => {
basic.showString("Hello!")
});
```
### Step 4
Click ``|Download|`` to transfer your code
and press **A** to scroll your text.
### Step 5
Place more blocks to display a smiley when button **B** is pressed.
Use the dropdown to find ``B``!
```block
input.onButtonPressed(Button.B, () => {
basic.showLeds(`
# # . # #
# # . # #
. . . . .
# . . . #
. # # # .
`)
})
```
### Step 6
Drag more blocks to display a frownie when @boardname@ is shaken.
```block
input.onGesture(Gesture.Shake, () => {
basic.showLeds(`
# # . # #
# # . # #
. . . . .
. # # # .
# . . . #
`)
})
```
### Step 7
Drag more blocks to display a random number when pin ``P0`` is touched.
Hold your right thumb on the ``GND`` metal pin
at press the ``0`` pin with your right hand to trigger this event.
```block
input.onPinPressed(TouchPin.P0, () => {
basic.showNumber(Math.random(7))
})
```

View File

@ -1,14 +1,14 @@
{
"applicationName": "pxt-microbit-oss",
"dataFolderName": ".pxt-microbit-oss",
"darwinBundleIdentifier": "com.microsoft.pxtoss",
"nameShort": "PXT Microbit - OSS",
"nameLong": "PXT Microbit - OSS",
"darwinBundleIdentifier": "com.microsoft.pxtmicrobitoss",
"nameShort": "PXT microbit - OSS",
"nameLong": "PXT micro:bit - OSS",
"targetId": "pxt-microbit",
"win32AppId": "{{92db071a-6f58-4938-8c97-13c873f4da13}",
"win32AppUserModelId": "Microsoft.PXTMicrobitOss",
"win32DirName": "Microsoft PXT-Microbit - OSS",
"win32AppUserModelId": "Microsoft.PXTmicrobitOss",
"win32DirName": "Microsoft PXT microbit - OSS",
"win32MutexName": "pxtmicrobitoss",
"win32NameVersion": "Microsoft PXT-Microbit-OSS",
"win32RegValueName": "PXTMicrobitOss"
"win32NameVersion": "Microsoft PXT microbit-OSS",
"win32RegValueName": "PXTmicrobitOss"
}

9
electron/release.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": {
"0": {
"latest": "v0.7.41",
"banned": [],
"prompt": "v0.7.41"
}
}
}

View File

@ -1,62 +1,4 @@
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="device_forever">
<statement name="HANDLER">
<block type="device_show_leds">
<field name="LED00">FALSE</field>
<field name="LED10">FALSE</field>
<field name="LED20">FALSE</field>
<field name="LED30">FALSE</field>
<field name="LED40">FALSE</field>
<field name="LED01">FALSE</field>
<field name="LED11">TRUE</field>
<field name="LED21">FALSE</field>
<field name="LED31">TRUE</field>
<field name="LED41">FALSE</field>
<field name="LED02">FALSE</field>
<field name="LED12">FALSE</field>
<field name="LED22">FALSE</field>
<field name="LED32">FALSE</field>
<field name="LED42">FALSE</field>
<field name="LED03">TRUE</field>
<field name="LED13">FALSE</field>
<field name="LED23">FALSE</field>
<field name="LED33">FALSE</field>
<field name="LED43">TRUE</field>
<field name="LED04">FALSE</field>
<field name="LED14">TRUE</field>
<field name="LED24">TRUE</field>
<field name="LED34">TRUE</field>
<field name="LED44">FALSE</field>
<next>
<block type="device_show_leds">
<field name="LED00">FALSE</field>
<field name="LED10">FALSE</field>
<field name="LED20">FALSE</field>
<field name="LED30">FALSE</field>
<field name="LED40">FALSE</field>
<field name="LED01">FALSE</field>
<field name="LED11">FALSE</field>
<field name="LED21">FALSE</field>
<field name="LED31">FALSE</field>
<field name="LED41">FALSE</field>
<field name="LED02">FALSE</field>
<field name="LED12">FALSE</field>
<field name="LED22">FALSE</field>
<field name="LED32">FALSE</field>
<field name="LED42">FALSE</field>
<field name="LED03">FALSE</field>
<field name="LED13">FALSE</field>
<field name="LED23">FALSE</field>
<field name="LED33">FALSE</field>
<field name="LED43">FALSE</field>
<field name="LED04">FALSE</field>
<field name="LED14">FALSE</field>
<field name="LED24">FALSE</field>
<field name="LED34">FALSE</field>
<field name="LED44">FALSE</field>
</block>
</next>
</block>
</statement>
</block>
<block type="pxt-on-start"></block>
<block type="device_forever"></block>
</xml>

View File

@ -1,16 +1 @@
basic.forever(() => {
basic.showLeds(`
. # . # .
# . # . #
# . . . #
. # . # .
. . # . .
`)
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
})

View File

@ -1,5 +1,14 @@
{
"bluetooth": "Support for additional Bluetooth services.",
"bluetooth": "Support for additional Bluetooth services.\n\nSupport for additional Bluetooth services.",
"bluetooth.advertiseUid": "Advertise an Eddystone UID",
"bluetooth.advertiseUidBuffer": "Advertise an Eddystone UID",
"bluetooth.advertiseUidBuffer|param|connectable": "true to keep bluetooth connectable for other services, false otherwise.",
"bluetooth.advertiseUidBuffer|param|nsAndInstance": "16 bytes buffer of namespace (bytes 0-9) and instance (bytes 10-15)",
"bluetooth.advertiseUidBuffer|param|power": "power level between 0 and 7, eg: 7",
"bluetooth.advertiseUid|param|connectable": "true to keep bluetooth connectable for other services, false otherwise.",
"bluetooth.advertiseUid|param|instance": "4 last bytes of the instance uid",
"bluetooth.advertiseUid|param|ns": "4 last bytes of the namespace uid",
"bluetooth.advertiseUid|param|power": "power level between 0 and 7, eg: 7",
"bluetooth.advertiseUrl": "Advertise an Eddystone URL",
"bluetooth.advertiseUrl|param|connectable": "true to keep bluetooth connectable for other services, false otherwise.",
"bluetooth.advertiseUrl|param|power": "power level between 0 and 7, eg: 7",

View File

@ -1,4 +1,5 @@
{
"bluetooth.advertiseUid|block": "bluetooth advertise UID|namespace (bytes 6-9)%ns|instance (bytes 2-6)%instance|with power %power|connectable %connectable",
"bluetooth.advertiseUrl|block": "bluetooth advertise url %url|with power %power|connectable %connectable",
"bluetooth.onBluetoothConnected|block": "on bluetooth connected",
"bluetooth.onBluetoothDisconnected|block": "on bluetooth disconnected",

View File

@ -1,4 +1,5 @@
{
"bluetooth.onBluetoothConnected|param|body": "Code, der ausgeführt wird, wenn eine Bluetooth-Verbindung aufgebaut wurde",
"bluetooth.uartWriteNumber": "Gibt einen numerischen Wert an die serielle",
"bluetooth.uartWriteValue": "Schreibt ein ``Namen: Wert`` Wertepaar auf die serielle Schnittstelle.",
"bluetooth.uartWriteValue|param|name": "Name des Wertestreams, z.B.: x",

View File

@ -0,0 +1,21 @@
{
"bluetooth.advertiseUid|block": "bluetooth kringkast UID|namespace (bytes 6-9)%ns|instance (bytes 2-6)%instance|med sendereffekt %power|kan tilkobles %connectable",
"bluetooth.advertiseUrl|block": "bluetooth kringkast url %url|med sendereffekt %power|kan tilkobles %connectable",
"bluetooth.onBluetoothConnected|block": "når bluetooth tilkobles",
"bluetooth.onBluetoothDisconnected|block": "når bluetooth frakobles",
"bluetooth.setTransmitPower|block": "bluetooth sett sendereffekt %power",
"bluetooth.startAccelerometerService|block": "bluetooth akselerometer-tjeneste",
"bluetooth.startButtonService|block": "bluetooth trykknapp-tjeneste",
"bluetooth.startIOPinService|block": "bluetooth digital tilkobling-tjeneste",
"bluetooth.startLEDService|block": "bluetooth LED-tjeneste",
"bluetooth.startMagnetometerService|block": "bluetooth magnetometer-tjeneste",
"bluetooth.startTemperatureService|block": "bluetooth temperatur-tjeneste",
"bluetooth.startUartService|block": "bluetooth serieport-tjeneste (UART)",
"bluetooth.stopAdvertising|block": "bluetooth stopp kringkasting",
"bluetooth.uartReadUntil|block": "bluetooth serieport|les frem til %del=serial_delimiter_conv",
"bluetooth.uartWriteNumber|block": "bluetooth serieport|skriv tall %value",
"bluetooth.uartWriteString|block": "bluetooth serieport|skriv tekst %data",
"bluetooth.uartWriteValue|block": "bluetooth serieport|skriv verdi %name|= %value",
"bluetooth|block": "bluetooth",
"{id:category}Bluetooth": "Bluetooth"
}

View File

@ -7,7 +7,7 @@ using namespace pxt;
/**
* Support for additional Bluetooth services.
*/
//% color=#0082FB weight=20
//% color=#0082FB weight=96 icon="\uf294"
namespace bluetooth {
MicroBitUARTService *uart = NULL;
@ -137,6 +137,24 @@ namespace bluetooth {
uBit.bleManager.setTransmitPower(power);
}
/**
* Advertise an Eddystone UID
* @param nsAndInstance 16 bytes buffer of namespace (bytes 0-9) and instance (bytes 10-15)
* @param power power level between 0 and 7, eg: 7
* @param connectable true to keep bluetooth connectable for other services, false otherwise.
*/
//% parts=bluetooth weight=12 advanced=true
void advertiseUidBuffer(Buffer nsAndInstance, int power, bool connectable) {
ManagedBuffer buf(nsAndInstance);
if (buf.length() != 16) return;
power = min(MICROBIT_BLE_POWER_LEVELS-1, max(0, power));
int8_t level = CALIBRATED_POWERS[power];
uint8_t uidNs[10]; buf.readBytes(uidNs, 0, 10);
uint8_t uidInst[6]; buf.readBytes(uidInst, 10, 6);
uBit.bleManager.advertiseEddystoneUid((const char*)uidNs, (const char*)uidInst, level, connectable);
}
/**
* Sets the bluetooth transmit power between 0 (minimal) and 7 (maximum).
* @param power power level between 0 (minimal) and 7 (maximum), eg: 7.

View File

@ -1,7 +1,7 @@
/**
* Support for additional Bluetooth services.
*/
//% color=#0082FB weight=20
//% color=#0082FB weight=96 icon="\uf294"
namespace bluetooth {
/**
* Writes to the Bluetooth UART service buffer. From there the data is transmitted over Bluetooth to a connected device.
@ -46,4 +46,21 @@ namespace bluetooth {
// dummy implementation for simulator
return "???"
}
/**
* Advertise an Eddystone UID
* @param ns 4 last bytes of the namespace uid
* @param instance 4 last bytes of the instance uid
* @param power power level between 0 and 7, eg: 7
* @param connectable true to keep bluetooth connectable for other services, false otherwise.
*/
//% blockId=eddystone_advertise_uid block="bluetooth advertise UID|namespace (bytes 6-9)%ns|instance (bytes 2-6)%instance|with power %power|connectable %connectable"
//% parts=bluetooth weight=12 blockGap=8
//% help=bluetooth/advertise-uid blockExternalInputs=1
export function advertiseUid(ns: number, instance: number, power: number, connectable: boolean) {
const buf = pins.createBuffer(16);
buf.setNumber(NumberFormat.Int32BE, 6, ns);
buf.setNumber(NumberFormat.Int32BE, 12, instance);
bluetooth.advertiseUidBuffer(buf, power, connectable);
}
}

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