Skip to content

Commit 756dcec

Browse files
committed
Merge pull request #29 from n0bisuke/master
add Japanese translation
2 parents 2726547 + f719d4b commit 756dcec

File tree

11 files changed

+428
-1
lines changed

11 files changed

+428
-1
lines changed

exercises/blink_blink/problem.ja.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# ようこそ nodebot-workshop へ
2+
3+
このワークショップでは`johnny-five`のAPIを学んでいきます。
4+
5+
`johnny-five`はArduinoや他のプロトタイピングボードを制御するためのAPIです。
6+
**このワークショップではArduinoなどは用意しなくても大丈夫です。**
7+
8+
出題される問題にチャレンジしてみましょう。
9+
The low level code to talk to the Arduino is stubbed out.
10+
11+
**実行可能な`johnny-five`のコードを記述していってください**
12+
13+
それぞれの回答は`node`プログラムとして実行可能となります。
14+
Arduinoに配線をつないだり、USB接続したりして回答コードがどのように動作するか確認してみましょう。
15+
16+
-------------------------------------------------------------------------------
17+
18+
# Lチカ
19+
20+
**Lチカをしてみましょう。 13pinにLEDを一つ接続し、毎秒ごとに点滅させましょう。**
21+
22+
- `board``ready`状態になったら`Led`インスタンスを作成しましょう。
23+
- `Led`インスタンス作成の初期化の際には接続するpinの番号を記述しましょう。
24+
- `Led`には`strobe`メソッドがあり、ミリ秒間隔で実行できます。
25+
26+
## まずは以下の手順が必要になります
27+
28+
1. `mkdir mysolutions`など任意のディレクトリを作成します。
29+
2. `cd mysolutions`で作成したディレクトリに移動しましょう。
30+
3. johnny-fiveをnpmから取得します。 `npm install johnny-five`
31+
4. `01-blink-blink.js`など、回答を記述するファイルを作成しましょう。
32+
33+
全ての回答には以下の記述が必要になります。
34+
35+
- `johnny-five`モジュールの`require`
36+
- `new Board`インスタンスの作成
37+
- `board`**ready** イベントのコールバック
38+
- 回答はこのコールバックの中で行います
39+
40+
```js
41+
var five = require('johnny-five')
42+
var board = new five.Board()
43+
board.on('ready', function () {
44+
45+
//回答をここに記述
46+
47+
})
48+
```
49+
50+
## 回路図
51+
52+
```
53+
LED 330
54+
Pin 13 o--->|----/\/\/----o GND
55+
```
56+
57+
## コンポーネント
58+
59+
- LED - http://node-ardx.org/electronics-primer#led
60+
61+
> 電流が流れると発光します。一方向のみです。
62+
63+
## ドキュメント
64+
65+
- Board - https://github.com/rwaldron/johnny-five/wiki/Board
66+
- Led - https://github.com/rwaldron/johnny-five/wiki/Led#api
67+
68+
---

exercises/fire_alarm/problem.ja.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
__温度が50°Cを超えると音がなる火災報知器を作りましょう__
2+
3+
* TMP36温度センサをA0pinに接続しましょう
4+
* ブザーを9pinに接続しましょう
5+
* LEDを13pinに接続しましょう
6+
* ボタンを5pinに接続しましょう
7+
* 温度が50°C 以上になったらブザーの音がなり、LEDが点滅します
8+
* 温度が50°C 以下に変化したらブザーとLEDがオフになります
9+
* また、ボタンを押すとブザーとLEDがオフになり、温度が50°C 以下になるまでは再びつくことはないようにしましょう
10+
11+
## 回路図
12+
13+
```
14+
LED 330
15+
Pin 13 o-------->|---------/\/\/--------
16+
|
17+
Pin 5 o---------------------- |
18+
| |
19+
10k | |
20+
+5 o----.--------/\/\/---. |
21+
| | |
22+
| | |
23+
| .--|--|--. |
24+
| | | | | |
25+
| Button --+-| | | |
26+
| | | | | |
27+
| '--|--|--' |
28+
| | |
29+
| ----------.---o GND
30+
__ |
31+
| \ |
32+
A0 o---| ) TMP36 |
33+
|__ / |
34+
| |
35+
---------------------------.
36+
|
37+
Piezo |
38+
_ |
39+
|| || |
40+
Pin 9 o-----------|| ||---------------
41+
||_||
42+
```
43+
44+
## ドキュメント
45+
46+
- LED - https://github.com/rwaldron/johnny-five/wiki/Led
47+
- Piezo - https://github.com/rwaldron/johnny-five/blob/master/docs/piezo.md
48+
- TMP36 - https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-tmp36.md
49+
- Button - https://github.com/rwaldron/johnny-five/wiki/Button#usage
50+
51+
---

exercises/light_switch/problem.ja.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
__スイッチを押すとLEDのon/offが切り替わるプログラムを書きましょう__
2+
3+
* ボタンを5pinに、LEDを9pinに接続しましょう
4+
* `Button`クラスと`press`イベントを使い、LEDのon/offを切り替えましょう
5+
6+
## 回路図
7+
8+
```
9+
LED 330
10+
Pin 9 o--->|-------/\/\/-----
11+
|
12+
Pin 5 o------------ |
13+
| |
14+
10k | |
15+
+5 o---/\/\/---. |
16+
| |
17+
| |
18+
.--|--|--. |
19+
| | | | |
20+
Button --+-| | | |
21+
| | | | |
22+
'--|--|--' |
23+
| |
24+
----------.---o GND
25+
```
26+
27+
## コンポーネント
28+
29+
- Button - http://node-ardx.org/electronics-primer#pushbutton
30+
31+
> 押されている状態のときに回路がつながります。
32+
33+
## ドキュメント
34+
35+
- Button - https://github.com/rwaldron/johnny-five/wiki/Button#usage
36+
- LED - https://github.com/rwaldron/johnny-five/wiki/Led#api
37+
38+
---

exercises/ping_bell/problem.ja.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
__メッセージを受信すると音が鳴るUDPサーバーを作りましょう__
2+
3+
* ブザーを8pinに接続します
4+
* `dgram`というNodeモジュールを使い、 **udp4** ソケットを作ります
5+
* **1337** ポートでメッセージを待ち受けるサーバーにしましょう
6+
* メッセージを受信したらブザーを鳴らしましょう
7+
8+
## 回路図
9+
10+
```
11+
Piezo
12+
_
13+
|| ||
14+
Pin 8 o---|| ||---o GND
15+
||_||
16+
```
17+
18+
## ドキュメント
19+
20+
- http://nodejs.org/api/dgram.html
21+
- https://github.com/rwaldron/johnny-five/blob/master/docs/piezo.md
22+
23+
---
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
__温度をあなたの身近なサービスに使おう__
2+
3+
最後に測ったTMP36温度センサの温度の値が返ってくるrpcサーバーを`dnode`を使って作りましょう。
4+
5+
* 温度センサをA0pinに接続しましょう
6+
* `dnode`をインストールしましょう。 -> `npm install dnode`
7+
* 1337ポートで待ち受けるdnodeサーバーを立ち上げましょう
8+
* rpcエンドポイントには`getTemperature`という関数を呼び出せるようにします
9+
* `getTemperature`**celsius** の値がコールバックで取得できるようにしましょう
10+
11+
## 回路図
12+
13+
```
14+
+5 o-----.
15+
|
16+
|
17+
__
18+
| \
19+
A0 o---| ) TMP36
20+
|__ /
21+
|
22+
|
23+
GND o-----'
24+
```
25+
26+
## コンポーネント
27+
28+
- TMP36 - http://node-ardx.org/electronics-primer#tempsensor
29+
30+
> Produces a variable resistance dependant on the ambient temperature.
31+
32+
## ヒント
33+
34+
- Remember, you're always working with voltages on pins
35+
- The value from a sensor is a representation of the voltage on that pin
36+
- You'll need to convert that value into a useful temperature reading...
37+
- To create an enpoint, pass dnode an object with your endpoint as a method
38+
- Your endpoint should take a callback and pass the value to it
39+
40+
## ドキュメント
41+
42+
- https://github.com/rwaldron/johnny-five/blob/master/docs/temperature-tmp36.md
43+
- dnode - https://github.com/substack/dnode
44+
45+
---

exercises/robot_arm/problem.ja.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
__遠隔制御できるロボットアームを作りましょう__
2+
3+
回転式ポテンショメータを使いサーボの位置をコントロールします。
4+
5+
* ポテンショメータをA2pinに接続します
6+
* 9pinにサーボを接続します
7+
* ポテンショメータを回転させるとサーボが回転します
8+
9+
## 回路図
10+
11+
```
12+
Servo
13+
.---.
14+
| | |
15+
-===+===-
16+
| | |
17+
| |
18+
'---'
19+
| | |
20+
| | |
21+
| | ------------------o Pin 9
22+
| |
23+
| ----------------.---o +5
24+
| |
25+
| Potentiometer |
26+
GND o---.------/\/\/------.
27+
^
28+
|
29+
|
30+
A2 o--------------
31+
32+
```
33+
34+
## コンポーネント
35+
36+
- Potentiometer - http://node-ardx.org/electronics-primer#pot
37+
38+
> Produces a variable resistance dependant on the angular position of the shaft.
39+
40+
## ドキュメント
41+
42+
- Sensor - https://github.com/rwaldron/johnny-five/wiki/Sensor
43+
- Fn - https://github.com/rwaldron/johnny-five/blob/master/lib/fn.js
44+
45+
## ヒント
46+
47+
- A potentiometer is another use case for the Sensor object...
48+
- A pot produces input values between 0 and 1023.
49+
- A servo can typically be moved between 0 and 179 degrees.
50+
- `five.Fn.map` can map the pot values (0 - 1023) to servo angles (0 - 179).
51+
52+
---

exercises/servo_wave/problem.ja.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
__3秒サーボを動かして、止めて、真ん中に戻しましょう。__
2+
3+
- 9pinに接続した`Servo`インスタンスを作成します
4+
- `servo.sweep`を使い0˚から180˚に回転させます
5+
- `board.wait`を'reset'コールバックの3秒後に使います
6+
- 'reset'コールバックでは`stop``center`にします
7+
- どこの行に書き足せばいいかドキュメントで確認しましょう
8+
9+
## ひな形
10+
11+
```js
12+
var five = require('johnny-five')
13+
var board = new five.Board()
14+
board.on('ready', function () {
15+
16+
//ここに回答を記述
17+
18+
})
19+
```
20+
21+
## 回路図
22+
23+
```
24+
Servo
25+
.---.
26+
| | |
27+
-===+===-
28+
| | |
29+
| |
30+
'---'
31+
| | |
32+
| | |
33+
GND o--. | .--o Pin 9
34+
|
35+
+5 o----.
36+
37+
```
38+
39+
## コンポーネント
40+
41+
- Servo - http://node-ardx.org/electronics-primer#servo
42+
43+
> Takes a timed pulse and converts it into an angular position of the output shaft.
44+
45+
## ドキュメント
46+
47+
- Servo - https://github.com/rwaldron/johnny-five/wiki/Servo#api
48+
- Board - https://github.com/rwaldron/johnny-five/wiki/Board#api
49+
50+
---
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
__9pinにモーターを接続してスピンさせましょう!__
2+
3+
* 200mphでモーターを回転させます
4+
* `board.wait`を使い2秒回転後に停止させましょう
5+
* 1秒後に回転再開させます
6+
* この流れを無限ループさせてください
7+
8+
ヒント:
9+
Hint: You could use the motor `start` and `stop` events to stop/start the motor.
10+
11+
## 回路図
12+
13+
```
14+
----o GND
15+
|
16+
330 |>
17+
Pin 9 o---/\/\/---| Transistor
18+
|\
19+
|
20+
|
21+
------.
22+
| |
23+
| _
24+
| / \
25+
Diode v ( o ) Motor
26+
- \_/
27+
| |
28+
| |
29+
+5 o-------.------
30+
```
31+
32+
## コンポーネント
33+
34+
- Motor - http://node-ardx.org/electronics-primer#dcmotor
35+
36+
> 電流を流すと回転します。
37+
38+
## ドキュメント
39+
40+
- Board - https://github.com/rwaldron/johnny-five/wiki/Board#api
41+
- Motor - https://github.com/rwaldron/johnny-five/wiki/Motor#api
42+
43+
---

0 commit comments

Comments
 (0)