Compare commits

...

16 Commits

Author SHA1 Message Date
d5488a3ae8 0.0.14 2016-03-29 13:55:36 -07:00
8a14a95fcc Bump kindscript to 0.1.119 2016-03-29 13:55:34 -07:00
d0fcd5f400 0.0.13 2016-03-29 13:47:07 -07:00
491c5faaf6 0.0.12 2016-03-29 13:39:32 -07:00
8179e38e41 Bump kindscript to 0.1.118 2016-03-29 13:39:30 -07:00
5a8a5f82c9 Merge branch 'master' of https://github.com/Microsoft/kindscript-microbit 2016-03-29 11:58:49 -07:00
c43088c099 quiz update 2016-03-29 11:57:50 -07:00
816d738390 0.0.11 2016-03-29 11:35:17 -07:00
3e133aa66e Bump kindscript to 0.1.117 2016-03-29 11:35:14 -07:00
a471c2cb1a 0.0.10 2016-03-29 08:41:30 -07:00
a5826540fa Bump kindscript to 0.1.115 2016-03-29 08:41:29 -07:00
1768881719 Simplify travis instructions 2016-03-29 08:26:18 -07:00
365c95b33d 0.0.9 2016-03-28 23:29:26 -07:00
d05fa9f4cb Bump kindscript to 0.1.114 2016-03-28 23:29:25 -07:00
acb0c66e85 some edits to about 2016-03-28 23:18:27 -07:00
a705b74fab 0.0.8 2016-03-28 22:28:10 -07:00
15 changed files with 148 additions and 62 deletions

View File

@ -2,8 +2,6 @@ language: node_js
node_js:
- "5.7.0"
script:
- "npm update"
- "node node_modules/kindscript/built/kind.js buildtarget"
- "node node_modules/kindscript/built/kind.js travis"
- "node node_modules/kindscript/built/kind.js uploaddoc"
sudo: false

View File

@ -1,14 +1,14 @@
# About
The [BBC micro:bit](https://www.microbit.co.uk) is a [pocket-size computer](/device) with 25 LEDs, Bluetooth and sensors that can be programmed by anyone.
The BBC micro:bit was made possible by [a number of partners!](https://www.microbit.co.uk/partners)
The [BBC micro:bit](https://www.microbit.co.uk) is a [pocket-size computer](/device) with a 5x5 display of 25 LEDs, Bluetooth and sensors that can be programmed by anyone.
The BBC micro:bit was made possible by many [partners](https://www.microbit.co.uk/partners).
The micro:bit provides a fun introduction to programming and making switch on, program it to do something fun wear it, customize it.
Just like Arduino, the micro:bit can be connected to and interact with sensors, displays, and other devices.
## Block Editor or JavaScript
## Blocks or JavaScript
The student can program the BBC micro:bit using a Block Editor or JavaScript.
The student can program the BBC micro:bit using [visual blocks](http://www.github.com/Google/blockly) or JavaScript.
```blocks
basic.showString("BBC micro:bit!");
@ -46,16 +46,9 @@ input.onGesture(Gesture.Shake, () => {
});
```
To run a student's project in the web browser, KindScript compiles it into JavaScript, the scripting language built into all web browsers.
C++ and Touch Develop Libraries
The C++ micro:bit library, created at Lancaster University, provides access to the hardware functions of the micro:bit, as well as a set of helper functions (such as displaying a number/image/string on the LED screen). The Touch Develop micro:bit library mirrors the functions of the C++ library. When a Touch Develop script is compiled to C++, the calls to Touch Develop micro:bit functions are replaced with calls to the corresponding C++ functions.
Above, see the mapping from the Touch Develop "show number" function to its corresponding the C++ function.
## C++ Runtime
The C++ BBC micro:bit library, created at [Lancaster University](http://www.lancaster.ac.uk/), provides access to the hardware functions of the micro:bit,
as well as a set of helper functions (such as displaying a number/image/string on the LED screen).
The JavaScript micro:bit library mirrors the functions of the C++ library.
When code is compiled to C++, the calls to JavaScript micro:bit functions are replaced with calls to the corresponding C++ functions.
When code is compiled to ARM machine code, the calls to JavaScript micro:bit functions are replaced with calls to the corresponding C++ functions.

View File

@ -10,7 +10,10 @@ Answers will vary. In general, plot refers to the code that turns on a specific
## 2. Draw which LED is ON after running this code
![](/static/mb/blocks/lessons/blink-6.png)
```blocks
led.plot(2, 2)
```
![](/static/mb/lessons/blink-0.png)
@ -18,7 +21,10 @@ By default, the position of an LED on *Blink Tutorial* is set to the centre of t
## 3. Draw which LED is ON after running this code
![](/static/mb/blocks/lessons/blink-7.png)
```blocks
led.plot(0, 0)
```
![](/static/mb/lessons/blink-1.png)
@ -29,7 +35,10 @@ This code turns on specific LED. Plot turns on the specified LED on the LED scre
## 4. Draw which LED is ON after running this code
![](/static/mb/blocks/lessons/blink-8.png)
```blocks
led.plot(4, 4)
```
![](/static/mb/lessons/blink-2.png)

View File

@ -12,23 +12,34 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
## 1. Describe what `plot` does?
<br/>
## 2. Draw which LED is ON after running this code
![](/static/mb/blocks/lessons/blink-6.png)
```blocks
led.plot(2, 2)
```
![](/static/mb/empty-microbit.png)
## 3. Draw which LED is ON after running this code
![](/static/mb/blocks/lessons/blink-7.png)
```blocks
led.plot(0, 0)
```
![](/static/mb/empty-microbit.png)
## 4. Draw which LED is ON after running this code
![](/static/mb/blocks/lessons/blink-8.png)
```blocks
led.plot(4, 4)
```
![](/static/mb/empty-microbit.png)

View File

@ -10,13 +10,15 @@ Pause program execution for the specified number of milliseconds.
## 2. Write the code that leaves an image on the screen for 1 second (1000 milliseconds)
<br/>
![](/static/mb/blocks/lessons/flashing-heart-5.jpg)
```blocks
basic.pause(1000)
```
## 3. Write the code that leaves an image on the screen for 1.5 seconds (1500 milliseconds)
![](/static/mb/blocks/lessons/flashing-heart-6.jpg)
```blocks
basic.pause(1500)
```
<br/>

View File

@ -12,19 +12,14 @@ Answer the questions while completing the activity. Pay attention to the dialogu
## 1. Describe what `pause` does?
<br/>
<br/>
## 2. Write the code that leaves an image on the screen for 1 second (1000 milliseconds)
<br/>
<br/>
## 3. Write the code that leaves an image on the screen for 1.5 seconds (1500 milliseconds)
<br/>
<br/>

View File

@ -14,7 +14,11 @@ It's a method that runs code when the user holds the GND pin with a finger of on
Create a condition for `on pin pressed (P0)`.
![](/static/mb/blocks/lessons/love-meter-0.jpg)
```blocks
input.onPinPressed(TouchPin.P0, () => {
})
```
## 3. What does this line of code doing?

View File

@ -12,25 +12,21 @@ Answer the questions below while completing the activity. Pay attention to the d
## 1. Describe what `on pin pressed` does?
<br/>
## 2. Create a condition for on pin pressed (P0).
<br/>
## 3. Describe what this line of code does?
![](/static/mb/blocks/lessons/love-meter-6.png)
<br/>
## 4. Describe what adding 1 to variable x does?
![](/static/mb/blocks/lessons/love-meter-7.png)
<br/>
## 5. Describe why you must hold ground (GND) before pressing (P0) to run a program using `on pin pressed(P0)` on the micro:bit
<br/>

View File

@ -12,13 +12,31 @@ This function turns off all the LED lights on the LED screen.
![](/static/mb/blocks/lessons/screen-wipe-4.png)
![](/static/mb/blocks/lessons/screen-wipe-5.png)
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . # . .
# . . . #
. # # # .
`)
```
## 3. Write the condition that will detect on button A pressed
![](/static/mb/blocks/lessons/screen-wipe-6.png)
```blocks
input.onButtonPressed(Button.A, () => {
})
```
## 4. Write the code that will clear show LEDS from the screen after pressing button A
![](/static/mb/blocks/lessons/screen-wipe-7.png)
```blocks
input.onButtonPressed(Button.A, () => {
basic.clearScreen()
})
```

View File

@ -12,19 +12,18 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
## 1. Describe what "clear screen" does?
<br/>
## 2. Write the code that clears an image from the screen
![](/static/mb/blocks/lessons/screen-wipe-4.png)
<br/>
## 3. Write the condition that will detect on button A pressed
<br/>
## 4. Write the code that will clear show LEDS from the screen after pressing button A
<br/>

View File

@ -16,13 +16,36 @@ The extra empty image with show LED creates a blinking smiley, allowing the micr
## 3. Draw the image created with this code
![](/static/mb/blocks/lessons/smiley-3.png)
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
```
![](/static/mb/blocks/lessons/smiley-4.png)
## 4. Write the code to make this image
![](/static/mb/blocks/lessons/smiley-5.png)
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
```
![](/static/mb/blocks/lessons/smiley-6.png)

View File

@ -10,27 +10,45 @@ Use the hints in the [Smiley](/microbit/lessons/smiley/activity) activity to ans
## 1. Describe what `show LEDs` does
<br/>
<br/>
## 2. Why is there an extra empty frame after the smiley face?
![](/static/mb/lessons/smiley-0.png)
<br/>
## 3. Draw the image created with this code
![](/static/mb/blocks/lessons/smiley-3.png)
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
```
![](/static/mb/empty-microbit.png)
<br/>
## 4. Draw the images created with this code
![](/static/mb/blocks/lessons/smiley-5.png)
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . . . .
# . . . #
. # # # .
`)
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
```
![](/static/mb/lessons/looper-3.png)

View File

@ -10,7 +10,17 @@ Run code in the background forever (answers may vary).
## 2. Draw the picture that will be produced with this code
![](/static/mb/blocks/lessons/snowflake-fall-4.png)
```blocks
basic.forever(() => {
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
});
```
![](/static/mb/lessons/flashing-heart-0.png)

View File

@ -10,21 +10,31 @@ Use the hints in the [snowflake fall activity](/microbit/lessons/snowflake-fall/
## 1. What is a forever loop?
<br />
## 2. Draw the picture that will be produced with this code
![](/static/mb/blocks/lessons/snowflake-fall-4.png)
```blocks
basic.forever(() => {
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`);
});
```
![](/static/mb/empty-microbit.png)
<br/>
## 3. Write the code for a forever loop and show LEDS for these images!
![](/static/mb/lessons/snowflake-fall-0.png)
<br/>
## 4. Write the code for a forever loop and show LEDS for these images!
@ -32,5 +42,5 @@ Use the hints in the [snowflake fall activity](/microbit/lessons/snowflake-fall/
![](/static/mb/lessons/snowflake-fall-2.png)
<br/>

View File

@ -1,6 +1,6 @@
{
"name": "kindscript-microbit",
"version": "0.0.7",
"version": "0.0.14",
"description": "BBC micro:bit target for KindScript",
"keywords": [
"JavaScript",
@ -30,6 +30,6 @@
"typescript": "^1.8.7"
},
"dependencies": {
"kindscript": "0.1.113"
"kindscript": "0.1.119"
}
}