batch replace onButtonPressed(Button...

This commit is contained in:
Peli de Halleux
2016-03-29 21:17:57 -07:00
parent 1f7e0b0f79
commit 850c313c5d
68 changed files with 187 additions and 187 deletions

View File

@ -9,14 +9,14 @@ Howdy! This [guided tutorial](/microbit/rxqgzy) will help you complete this acti
In this guide, you will learn how to use buttons and show text on the screen. Let's start by adding to respond **when the left button is pressed**.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
})
```
All the code inside `input->on button pressed` runs when the button is pressed. Let's add the code to show some text.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.showString("hello", 150)
})
```
@ -26,10 +26,10 @@ input.onButtonPressed("A", () => {
Let's add an event handler for Button `B`.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.showString("hello", 150)
})
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
})
```
@ -38,10 +38,10 @@ input.onButtonPressed("B", () => {
Display `bye` when the `B` button is pressed.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
basic.showString("hello", 150)
})
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
basic.showString("bye", 150)
})
```