diff --git a/clients/chrome/README.md b/clients/chrome/README.md index b3261250..145114bc 100644 --- a/clients/chrome/README.md +++ b/clients/chrome/README.md @@ -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 diff --git a/docs/projects/inchworm/servo.md b/docs/device/servo.md similarity index 87% rename from docs/projects/inchworm/servo.md rename to docs/device/servo.md index 221dab6a..6bd7acb0 100644 --- a/docs/projects/inchworm/servo.md +++ b/docs/device/servo.md @@ -1,13 +1,4 @@ -# Preparing the servo -### @description Connecting the servo to crocodile clips - -### ~avatar avatar - -Equip the microservo with crocodile clips. - -### ~ - -## Duration: ~30 minutes +# Equipping a microservo with Crocodile clips ## Materials * Cutting pliers or wire cutter @@ -70,7 +61,7 @@ Place the cables next to each other 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 solver this connection. +**If you have access to a soldering iron, we strongly recommend to solder this connection.** ### ~ @@ -105,11 +96,9 @@ When attaching the crocodile clips to the pins, don't hesitate to grab the side * Download the following code to your @boardname@ ```blocks -let a = 0 basic.forever(() => { - a = input.acceleration(Dimension.X) pins.servoWritePin(AnalogPin.P0, pins.map( - a, + input.acceleration(Dimension.X), -512, 512, 0, @@ -121,10 +110,7 @@ basic.forever(() => { * 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. - - -### ~button /projects/inchworm/chassis -NEXT: Chassis -### ~ \ No newline at end of file +This is probably due to a weak connection or low battery level. Check each connection and check your batteries. \ No newline at end of file diff --git a/docs/projects.md b/docs/projects.md index 9ed7f230..8f15b5a3 100644 --- a/docs/projects.md +++ b/docs/projects.md @@ -62,17 +62,13 @@ Fun games to build with your @boardname@. }] ``` -## Science and Engineering +## Toys ```codecard [{ "name": "Inchworm", "url":"/projects/inchworm", "imageUrl":"/static/mb/projects/inchworm.jpg" -}, { - "name": "Timing gates", - "url":"/projects/timing-gates", - "imageUrl":"/static/mb/projects/timing-gates.jpg" }] ``` @@ -80,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" @@ -96,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) \ No newline at end of file +[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) diff --git a/docs/projects/banana-keyboard.md b/docs/projects/banana-keyboard.md index 85d0d302..8aa41da0 100644 --- a/docs/projects/banana-keyboard.md +++ b/docs/projects/banana-keyboard.md @@ -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! diff --git a/docs/projects/banana-keyboard/beat-box.md b/docs/projects/banana-keyboard/code.md similarity index 98% rename from docs/projects/banana-keyboard/beat-box.md rename to docs/projects/banana-keyboard/code.md index d5040ef5..c4195061 100644 --- a/docs/projects/banana-keyboard/beat-box.md +++ b/docs/projects/banana-keyboard/code.md @@ -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! diff --git a/docs/projects/banana-keyboard/make.md b/docs/projects/banana-keyboard/make.md index d9e5cbec..e799a42f 100644 --- a/docs/projects/banana-keyboard/make.md +++ b/docs/projects/banana-keyboard/make.md @@ -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 ### ~ diff --git a/docs/projects/coffee-cup-monster.md b/docs/projects/coffee-cup-monster.md new file mode 100644 index 00000000..3d4e5e39 --- /dev/null +++ b/docs/projects/coffee-cup-monster.md @@ -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! + +### ~ diff --git a/docs/projects/coffee-cup-monster/code.md b/docs/projects/coffee-cup-monster/code.md new file mode 100644 index 00000000..58bb2137 --- /dev/null +++ b/docs/projects/coffee-cup-monster/code.md @@ -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 +### ~ \ No newline at end of file diff --git a/docs/projects/coffee-cup-monster/connect.md b/docs/projects/coffee-cup-monster/connect.md new file mode 100644 index 00000000..29a8386b --- /dev/null +++ b/docs/projects/coffee-cup-monster/connect.md @@ -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 +``` \ No newline at end of file diff --git a/docs/projects/coffee-cup-monster/make.md b/docs/projects/coffee-cup-monster/make.md new file mode 100644 index 00000000..502f4829 --- /dev/null +++ b/docs/projects/coffee-cup-monster/make.md @@ -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 +### ~ \ No newline at end of file diff --git a/docs/projects/hack-your-headphones.md b/docs/projects/hack-your-headphones.md index 3d07bf4c..9d3aed31 100644 --- a/docs/projects/hack-your-headphones.md +++ b/docs/projects/hack-your-headphones.md @@ -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 diff --git a/docs/projects/hack-your-headphones/music-of-light.md b/docs/projects/hack-your-headphones/code.md similarity index 98% rename from docs/projects/hack-your-headphones/music-of-light.md rename to docs/projects/hack-your-headphones/code.md index 42e966c8..bcb153bc 100644 --- a/docs/projects/hack-your-headphones/music-of-light.md +++ b/docs/projects/hack-your-headphones/code.md @@ -1,4 +1,4 @@ -# hack your headphones - music of light +# Code ### ~avatar avatar diff --git a/docs/projects/hack-your-headphones/make.md b/docs/projects/hack-your-headphones/make.md index 680e3ec6..0c6b902f 100644 --- a/docs/projects/hack-your-headphones/make.md +++ b/docs/projects/hack-your-headphones/make.md @@ -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 diff --git a/docs/projects/inchworm.md b/docs/projects/inchworm.md index 10ff740e..e9bc9aef 100644 --- a/docs/projects/inchworm.md +++ b/docs/projects/inchworm.md @@ -1,7 +1,7 @@ # Inchworm -### @description A inchworm like robot built with the micro:bit +### @description A inchworm like robot built with the @boardname@ ### ~avatar avatar @@ -27,13 +27,17 @@ https://youtu.be/BiZLjugXMbM ![Materials](/static/mb/projects/inchworm/materials.jpg) +## Preparation + +* [Equip the microservo with crocodile clips](/device/servo) + ## Activities -* [Servo](/projects/inchworm/servo) -* [Chassis](/projects/inchworm/chassis) +* [Make](/projects/inchworm/make) * [Code](/projects/inchworm/code) +* [Connect](/projects/inchworm/connect) -### ~button /projects/inchworm/servo +### ~button /projects/inchworm/make Let's get started! diff --git a/docs/projects/inchworm/code.md b/docs/projects/inchworm/code.md index d4ca74ca..ec131f10 100644 --- a/docs/projects/inchworm/code.md +++ b/docs/projects/inchworm/code.md @@ -30,23 +30,6 @@ so that the inchworm goes as fast as possible. Trying it on carpet also great he ### ~ -## Step 2: radio controlled inchworm - -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 -``` \ No newline at end of file +### ~button /projects/inchworm/connect +NEXT: Connect +### ~ \ No newline at end of file diff --git a/docs/projects/inchworm/connect.md b/docs/projects/inchworm/connect.md new file mode 100644 index 00000000..1ff82d50 --- /dev/null +++ b/docs/projects/inchworm/connect.md @@ -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 +``` \ No newline at end of file diff --git a/docs/projects/inchworm/chassis.md b/docs/projects/inchworm/make.md similarity index 99% rename from docs/projects/inchworm/chassis.md rename to docs/projects/inchworm/make.md index 1668ec63..e7e7f9fc 100644 --- a/docs/projects/inchworm/chassis.md +++ b/docs/projects/inchworm/make.md @@ -1,4 +1,4 @@ -# Chassis +# Make ### @description Building the cardboard inchworm ### ~avatar avatar diff --git a/docs/projects/telegraph.md b/docs/projects/telegraph.md index 1656780f..ba4a2652 100644 --- a/docs/projects/telegraph.md +++ b/docs/projects/telegraph.md @@ -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! diff --git a/docs/projects/telegraph/manual-telegraph.md b/docs/projects/telegraph/code.md similarity index 98% rename from docs/projects/telegraph/manual-telegraph.md rename to docs/projects/telegraph/code.md index 658d5e0b..c79a0b73 100644 --- a/docs/projects/telegraph/manual-telegraph.md +++ b/docs/projects/telegraph/code.md @@ -1,4 +1,4 @@ -# telegraph - manual telegraph +# Code Let's build the code that will send a impulse while the user presses ``A``. diff --git a/docs/projects/telegraph/make.md b/docs/projects/telegraph/make.md index 7251ed0d..ac0ddfef 100644 --- a/docs/projects/telegraph/make.md +++ b/docs/projects/telegraph/make.md @@ -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 ### ~ diff --git a/docs/projects/wallet/code.md b/docs/projects/wallet/code.md index 0217688a..9a4790e0 100644 --- a/docs/projects/wallet/code.md +++ b/docs/projects/wallet/code.md @@ -1,4 +1,4 @@ -# Wallet - Code +# Code ## Simple animation diff --git a/docs/projects/wallet/make.md b/docs/projects/wallet/make.md index 3dbf957d..776ff17e 100644 --- a/docs/projects/wallet/make.md +++ b/docs/projects/wallet/make.md @@ -1,4 +1,4 @@ -# Wallet - Make +# Make ### @description Maker Project for Wallet diff --git a/docs/reference/bluetooth/advertise-uid-buffer.md b/docs/reference/bluetooth/advertise-uid-buffer.md index 2b25d305..062408df 100644 --- a/docs/reference/bluetooth/advertise-uid-buffer.md +++ b/docs/reference/bluetooth/advertise-uid-buffer.md @@ -25,7 +25,7 @@ bluetooth.advertiseUidBuffer(pins.createBuffer(16), 7, true); * ``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 micro:bit should accept connections. +* ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections. ## See Also diff --git a/docs/reference/bluetooth/advertise-uid.md b/docs/reference/bluetooth/advertise-uid.md index 00c36573..50d95f63 100644 --- a/docs/reference/bluetooth/advertise-uid.md +++ b/docs/reference/bluetooth/advertise-uid.md @@ -26,7 +26,7 @@ bluetooth.advertiseUid(42, 1, 7, true); * ``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 micro:bit should accept connections. +* ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections. ## Encoding diff --git a/docs/reference/bluetooth/advertise-url.md b/docs/reference/bluetooth/advertise-url.md index bfdd1507..0e2a0275 100644 --- a/docs/reference/bluetooth/advertise-url.md +++ b/docs/reference/bluetooth/advertise-url.md @@ -25,7 +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 micro:bit should accept connections. +* ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections. ### Example: Broadcast a secret code diff --git a/libs/core/control.cpp b/libs/core/control.cpp index 5e64f4ee..a3509a63 100644 --- a/libs/core/control.cpp +++ b/libs/core/control.cpp @@ -193,6 +193,7 @@ namespace control { * Gets a friendly name for the device derived from the its serial number */ //% blockId="control_device_name" block="device name" weight=10 blockGap=8 + //% advanced=true StringData* deviceName() { return ManagedString(microbit_friendly_name()).leakData(); } @@ -201,6 +202,7 @@ namespace control { * Derive a unique, consistent serial number of this device from internal data. */ //% blockId="control_device_serial_number" block="device serial number" weight=9 + //% advanced=true int deviceSerialNumber() { return microbit_serial_number(); } diff --git a/libs/core/control.ts b/libs/core/control.ts index 0f4ed749..d62ad7f1 100644 --- a/libs/core/control.ts +++ b/libs/core/control.ts @@ -9,7 +9,7 @@ namespace control { * Returns the value of a C++ runtime constant */ //% weight=2 weight=19 blockId="control_event_source_id" block="%id" blockGap=8 - //% shim=TD_ID + //% shim=TD_ID advanced=true export function eventSourceId(id: EventBusSource): number { return id; } @@ -17,7 +17,7 @@ namespace control { * Returns the value of a C++ runtime constant */ //% weight=1 weight=19 blockId="control_event_value_id" block="%id" - //% shim=TD_ID + //% shim=TD_ID advanced=true export function eventValueId(id: EventBusValue): number { return id; } diff --git a/libs/core/music.ts b/libs/core/music.ts index da968942..bbaef452 100644 --- a/libs/core/music.ts +++ b/libs/core/music.ts @@ -174,7 +174,7 @@ namespace music { */ //% weight=50 help=music/note-frequency //% blockId=device_note block="%note" - //% shim=TD_ID + //% shim=TD_ID blockHidden=true export function noteFrequency(name: Note): number { return name; } diff --git a/libs/core/shims.d.ts b/libs/core/shims.d.ts index 2cdcc5c6..d039220a 100644 --- a/libs/core/shims.d.ts +++ b/libs/core/shims.d.ts @@ -415,13 +415,15 @@ declare namespace control { /** * Gets a friendly name for the device derived from the its serial number */ - //% blockId="control_device_name" block="device name" weight=10 blockGap=8 shim=control::deviceName + //% blockId="control_device_name" block="device name" weight=10 blockGap=8 + //% advanced=true shim=control::deviceName function deviceName(): string; /** * Derive a unique, consistent serial number of this device from internal data. */ - //% blockId="control_device_serial_number" block="device serial number" weight=9 shim=control::deviceSerialNumber + //% blockId="control_device_serial_number" block="device serial number" weight=9 + //% advanced=true shim=control::deviceSerialNumber function deviceSerialNumber(): number; }