$30 off During Our Annual Pro Sale. View Details »

Scratch + Raspberry Pi で LED をチカチカさせよう!

Scratch + Raspberry Pi で LED をチカチカさせよう!

横浜インターナショナルスクールの #beyondlaptops という国際カンファレンスで実施したワークショップです。

詳細: https://yasslab.jp/ja/workshops/raspi/

#beyondlaptops
http://blogs.yis.ac.jp/beyondlaptops/2014/04/16/2014-themes/

Yohei Yasukawa

January 07, 2017
Tweet

More Decks by Yohei Yasukawa

Other Decks in Education

Transcript

  1. Scratch + Raspberry Pi ϫʔΫγϣοϓ
 ϓϩάϥϛϯάͰLEDΛνΧνΧͤ͞Α͏! 2014/04/17(೔) ҆઒ ཁฏ YassLab

  2. ※ϫʔΫγϣοϓΛ࣮ࢪ͢Δํ΁ • ͜ͷεϥΠυ͸ɺԣ඿ΠϯλʔφγϣφϧεΫʔϧͰ։͔Ε࣮ͨࡍͷ ϫʔΫγϣοϓΛݩʹ࡞੒ɾެ։͞Ε͍ͯ·͢.
 ɹ౰೔ͷࣸਅ͸, ࣍ͷαΠτ͔ΒݟΔ͜ͱ͕Ͱ͖·͢.
 ɹ https://yasslab.jp/ja/workshops/raspi/ • ର৅ɿϓϩάϥϛϯάະܦݧऀͷখֶੜʙதֶੜ


    ࣌ؒɿ̍࣌ؒ൒͙Β͍ • ͜ͷϫʔΫγϣοϓͰ͸ Raspberry Pi ͱ͍͏ίϯϐϡʔλΛ࢖͍·͢.
 Raspberry Pi ͷೖखํ๏ɾ૊Έཱͯํ͸ɺ࣍Λࢀߟʹͯ͠Լ͍͞. ɹϥζϕϦʔύΠͷ૊Έཱͯํ, Programming Education Gathering
 http://pegpeg.jp/curriculum/683 * ΑΓৄࡉͳࢿྉ͸, ຊεϥΠυ຤ඌʹ͋ΔࢀߟจݙΛࢀর͍ͯͩ͘͠͞.
  3. ΍ͬͯΈΑ͏: Raspberry PiͷηοτΞοϓ 64#ΩʔϘʔυ64#Ϛ΢ε ϥζϕϦʔύΠ 5ZQF# )%.*σΟεϓϨΠ

  4. ΩʔϘʔυͱ Ϛ΢ε༻ͷUSB (ඞཁͳΒ)
 Πϯλʔωοτ༻
 ͷLANέʔϒϧ σΟεϓϨΠ ༻ͷHDMI ిݯ༻ 
 Micro

    USB ిࢠ޻࡞༻ͷϐϯ ىಈ͢ΔͨΊͷ SDΧʔυ (OS༻) ࠓճͷϫʔΫγϣοϓ
 Ͱ࢖༻͢Δϙʔτ
  5. ࠓ೔΍Δ͜ͱ ·ͱΊ Scratch Ͱϓϩάϥϛϯά! Raspberry Pi Ͱ LED νΧνΧ!

  6. Scratch Ͱϓϩάϥϛϯά͢Δͷ͸εΰ͍؆୯!
 ૣ଎, σεΫτοϓʹ͋ΔωίͷΞΠίϯΛΫϦοΫ!

  7. ΍ͬͯΈΑ͏: ωίา͖

  8. ͜Ε͚ͩͰωίΛา͔ͤΔ͜ͱ͕Ͱ͖Δ!
 ଞʹ΋৭Μͳ౴͕͑͋Δ! ΍ͬͯΈΑ͏: ωίา͖

  9. ଞͷ࡞඼ྫ: ωίୟ͖

  10. ଞͷ࡞඼ྫ: ωίಀ͛

  11. ࠓ೔΍Δ͜ͱ ·ͱΊ Scratch Ͱϓϩάϥϛϯά! Raspberry Pi Ͱ LED νΧνΧ!

  12. ϒϨουϘʔυ ഑ઢΛ͢Δͱ͖ʹ࢖͏ج൘. 
 (≒ ·ͳ൘)
 
 ͋ͱͰઆ໌͢ΔLED΍఍߅ͳ ͲΛɺ͜ͷϒϨουϘʔυʹ ࠩͯ͠ (഑ઢͯ͠)ɺLEDΛν

    ΧνΧͤ͞ΔΑ!

  13. LED 
 (ൃޫμΠΦʔυ) ిؾΛྲྀ͢ͱޫΔ෦඼. • ୹͍ํ͕ϚΠφε (-) • ௕͍ํ͕ϓϥε (+)

    ୹͍ ϚΠφε ௕͍ ϓϥε
  14. δϟϯύʔ
 ϫΠϠʔ ഑ઢ͢Δͱ͖ʹ࢖͏ઢ.
 
 Α͘ݟΔͱ̎छྨͷܗ͕͋ͬͯ, ϥζϕϦʔύΠʹࠩ͢༻(Φε)ͱ ϒϨουϘʔυʹࠩ͢༻(ϝε)ͷ ̎ͭͷܗ͕͋ΔΑ!
 
 *

    ઢͷ৭͸ؔ܎ͳ͍Α! Φε ϒϨου
 Ϙʔυ༻ ϝε ϥζύΠ༻
  15. ఍߅ ిؾΛ੍ޚ͢Δ෦඼.
 
 LEDΛڧ͘ޫΒͤͨΓɺ
 ऑ͘ޫΒͤͨΓͰ͖ΔΑɻ ‘ί’ͷࣈʹۂ͛ͯɺ ϒϨουϘʔυʹࠩͦ͏!

  16. ΍ͬͯΈΑ͏: ϥζύΠͱLEDΛܨ͙ 1). LEDճ࿏ΛϒϨουϘʔυ্ʹ࡞ͬͯ,
 2).ϥζϕϦʔύΠͷ GPIO ͱܨ͍ͩΒ,
 3). Scratch Ͱ

    LED ΛνΧνΧͤͯ͞ΈΑ͏!
  17. 1). LEDճ࿏ΛϒϨουϘʔυ্ʹ࡞Δ! ୹͍ ϚΠφε ௕͍ ϓϥε

  18. 2). ϥζϕϦʔύΠͷ GPIO ͱܨ͝͏!

  19. 3). Scratch Ͱ LED ΛνΧνΧ! 1. Scratch Λดͯ͡, 2. Scratch

    GPIO4 Λ։͍ͨΒ, 3. ϑΝΠϧ → ։͘ˠblink11ΛબΜͰ, 4. ྘৭ͷض () ΛΫϦοΫͯ͠ΈΑ͏!
  20. ΩʔϘʔυͷεϖʔεΩʔ Λԡ͍ͯ͠Δ͚ؒͩ, 
 LEDΛޫΒͤͯΈΑ͏! εϖʔεΩʔΛ཭ͨ͠Β, LEDͷޫ͸ফ͑ͯΔ͔ͳ? 
 ώϯτ: ͷதʹ͋Δ ϒϩοΫ͕࢖͑Δ͔΋…!?

    ΍ͬͯΈΑ͏: 
 εϖʔεͰνΧνΧ
  21. ͜Μͳ౴͑ํ͕Ͱ͖ΔΑ! ΍ͬͯΈΑ͏: 
 εϖʔεͰνΧνΧ

  22. LEDΛগͣͭ͠ޫΒͤͯΈΑ͏ ͱ͍͏ϒϩοΫΛ࢖ͬͯ Ώͬ͘ΓͱޫΒͤͯΈͤΑ͏! 1. ม਺ΛΫϦοΫͨ͠Β,
 ৽͍͠ม਺Λ࡞ΔΛΫϦοΫ. 2. ม਺໊ʹ Power11 ͱॻ͍ͯ,


    OK ΫϦοΫ. 3. ݱΕͨ Power11 ΛμϒϧΫϦοΫ. 4. εϥΠμʔ͕ग़͖ͯͨΒ,
 Power11 ͷ஋Λม͑ͯΈΑ͏!
  23. ΍ͬͯΈΑ͏: 
 ͲΜͲΜนʹۙͮ͘ͱ
 ͩΜͩΜڧ͘ޫΔ • ωί͕ࠨӈͷนʹ͍ۙͮͨ, LEDΛڧ͘ޫΒͤͯΈΑ͏! • ώϯτ: 


    ωίͷҐஔ͕஌Γ͍ͨ? 
 ɹɹɹɹ ͷதʹ͋ΔԿ͔ͷ ϒϩοΫΛ࢖͏ͱ෼͔ΔΑ! ωί͕นʹ͍͍ۙͮͯ͘ͱ LED͕গͣͭ͠ޫΔ!
  24. ͜Μͳ౴͑ํ͕Ͱ͖ΔΑ! ΍ͬͯΈΑ͏: 
 ͲΜͲΜนʹۙͮ͘ͱ
 ͩΜͩΜͱڧ͘ޫΔ ωί͕นʹ͍͍ۙͮͯ͘ͱ LED͕গͣͭ͠ޫΔ!

  25. ࠓ೔΍Δ͜ͱ ·ͱΊ Scratch Ͱϓϩάϥϛϯά! Raspberry Pi Ͱ LED νΧνΧ!

  26. 2014/04/17(೔) ҆઒ ཁฏ @YasuLabɹ Scratch + Raspberry Pi ϫʔΫγϣοϓ
 ϓϩάϥϛϯάͰLEDΛνΧνΧͤ͞Α͏!

  27. ࢀߟจݙ • Raspberry PiͰ͸͡ΊΔ Ͳ͖Ͳ͖ϓϩάϥϛϯά (͸͡ΊΔϓϩάϥ ϛϯά γϦʔζ) Ѩ෦ ࿨޿

    (ஶ, ؂म), ੴݪ ३໵ (ஶ), Ԙ໺ ఓོ (ஶ):
 http://www.amazon.co.jp/Raspberry-PiͰ͸͡ΊΔ-Ͳ͖Ͳ͖ϓϩ άϥϛϯά-͸͡ΊΔϓϩάϥϛϯά-γϦʔζ/dp/4822297314 • PEG (Programming Education Gathering):
 http://pegpeg.jp/ • Scratch GPIO version 4
 http://cymplecy.wordpress.com/2013/04/22/scratch-gpio- version-2-introduction-for-beginners/ (ӳޠͷΈ) • Raspberry Pi - Wikipedia : 
 http://ja.wikipedia.org/wiki/Raspberry_Pi