こんにちは。DevRelチャンネル外部ライターの加藤恵美(かとえみ)です。先日、同じ会社の人に「ツイートを大声で勝手に読み上げる悪魔のロボット」を作られてしまいました。

将来、もしかしたらこのロボットが、勝手にいろんなところへ行ってしまうかもしれませんし、あなたの会社に訪問してくるかもしれません。今の世の中、誰でも手に入る部品でこんなものが作れてしまうようです。
これは、止めなければいけない。
まったく仕組みがわからないのですが、自分の身を自分で守るためにも、基幹として使われている「Raspberry Pi(以下:ラズベリーパイ、ラズパイ)」というマイコンボードをいじり、「ラズパイ」でロボットを作る仕組みを勉強していきます!
連載5回目の今回は、前回の記事で初期設定を終えたマイラズベリーパイで、どんなことができるのか、ラズベリーパイの機能を一通り確認し、Scratchでプログラミングをしてみます。「ツイートを大声で勝手に読み上げる悪魔のロボット」を作った張本人の「今井先生」にラズベリーパイの機能を教えてもらいます。
1. ラズベリーパイの機能をひと通り見てみよう
さっそくラズベリーパイを起動します。「起動ボタン」がなく、電源ケーブルを挿したら起動が始まるので、最後に挿します。
![]() |
【ラズパイ入門22】 電源ケーブルは最後に挿すのがおすすめ。 ただし、電源ケーブルを抜くときは、シャットダウンをしてからにしましょう。 |
---|
起動しました。


1-1. プログラミング
もともと「子供のプログラミング教育」を目的として作られたものであることもあり、プログラミングのアプリケーションがたくさん入っています。


1-2. オフィス



1-3. インターネット



1-4. ゲーム




1-5. アクセサリ


![]() |
【ラズパイ入門23】 ラズベリーパイの中身は、いたって普通のパソコン |
---|
・
・
・



じゃあ、今井先生がいつも使っている「Scratch」ってどんな感じですか?

2. Scratchでプログラミング
今井先生が「Scratch」と言うのを何度も聞いたことがある、という理由だけで口走ってしまったために、Scratchに初挑戦することになりました。
- Scratchとは
- MITメディアラボのミッチェル・レズニック氏が開発した、ビジュアルプログラミングを用いたプログラミング環境。難しいコードを書かなくても、ブロックを組み合わせるだけでコンピュータへの命令を直感的におこなえる。
さっそくScratchを起動してみます。
このキャラクターは、「スクラッチ・キャット」というそうです。犬にも見えます。
右下の枠に表示されているのが、「スプライト」と呼ばれるオブジェクト。左ブロックに表示されている「スクリプト」を枠内でつなぐことで、それぞれのオブジェクトの動きをプログラミングしていきます(ブロックプログラミングといいます)。
プログラミングの結果は、右上の「ステージ」と呼ばれるところに出力されます。


(ちょっとFacebookでも見ちゃお〜)


・
・
・
〜30分後〜

こちらのようにブロックを組むと、ネコが動きます。より詳しい使い方は、以下のリンクをご参照ください。
- Scratch参考リンク
- プログラムを書かないプログラミング入門 | プログラミングとゲームの杜
このページでは、Scratch(スクラッチ)ゲーム開発講座の一部と生徒作品を紹介します♪
小学生からはじめるわくわくプログラミング eBook: 阿部 和広



![]() |
【ラズパイ入門24】 Scratchは簡単にできて、けっこうおもしろい |
---|


3. LXTerminalを始めよう

そういうの苦手なんです! 無理無理無理!!!


っていやいや!!!!! むりでしょ!!!! 絶対にやだ!!!!!


おわりに
ラズベリーパイの基本的な機能について確認しました。次回からは、いよいよラズベリーパイを使ったロボットプログラミングです。
今井先生は楽しみにしているようですが、本当にプログラミングって楽しいんでしょうか。不安でいっぱいです。
- 「Raspberry Pi」に関する記事はこちら