Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Raspberry Pi財団謹製HATボード「Sense HAT」で遊んでみた / 20170218-hakoneonsen-sensehat

Akira Ouchi
February 18, 2017

Raspberry Pi財団謹製HATボード「Sense HAT」で遊んでみた / 20170218-hakoneonsen-sensehat

2017/2/18サーバー構築ハンズオン15周年記念温泉合宿in箱根にて発表

Akira Ouchi

February 18, 2017
Tweet

More Decks by Akira Ouchi

Other Decks in Programming

Transcript

  1. 3BTQCFSSZ1Jࡒஂ
    ۘ੡)"5Ϙʔυ
    ʮ4FOTF)"5ʯͰ
    ༡ΜͰΈͨ
    ͖͋ͬ͌ JE"LLJFTPGU


    αʔόʔߏஙϋϯζΦϯप೥ه೦
    ·ͨ·ͨ Թઘ߹॓ JOശࠜ

    View full-size slide

  2. ࣗݾ঺հ
    • ͖͋ͬ͌ !"LLJFTPGU
    Ͱ͢
    • +BQBOFTF3BTQCFSSZ1J6TFST(SPVQ
    – ෍ڭ׆ಈΈ͍ͨͳ΍ͭΛ04$Ͱ΍Δ
    • &KFDUίϚϯυϢʔβʔձओ࠻
    • 3BTQCFSSZ1J͍͖ͩ͢ʔ
    – ୆͘Β͍΋ͬͯΔ
    – ୆Λӽ͑ͳ͍౒ྗΛ͍ͯ͠Δ࠷தʜ

    View full-size slide

  3. ࠷ۙͷωλ
    • ೥݄ͷ#*(3BTQCFSSZ+".ͷ༷ࢠ
    ͕ࢠڙͷՊֶ೥݄߸ʹࡌΓ·ͨ͠
    • ࢲ͕Ͱ͔Ͱ͔ࡌ̸͈̰̱̰ͬͯͯ

    View full-size slide

  4. +BQBOFTF3BTQCFSSZ1J
    6TFST(SPVQ
    • SBTQJKQͰ3BTQCFSSZ1Jͷ৘ใΛൃ৴
    – ͍͍ͩͨࢲ͕ॻ͍ͯ·͢
    • .- (PPHMF(SPVQT
    ͷӡӦ
    • Πϕϯτ
    – ݱࡏ͸͓΋ʹ04$ʹలࣔɾηϛφʔग़ల
    – 3BTQCFSSZ+". 3BTQCFSSZ1JϢʔβʔͷू
    ·Γ
    Λෆఆظ։࠵

    View full-size slide

  5. 4FOTF)"5ͱ͸ʁ
    • 3BTQCFSSZ1Jࡒஂ͕։ൃͨ͠)"5Ϙʔυ
    • "TUSP1JϓϩδΣΫτͷͨΊʹ։ൃ
    – IUUQTBTUSPQJPSH
    • ೥݄ʹࠃࡍӉ஦ηϯλʔʹଧ্ͪ
    ࣮͛ͯࡍʹಈ͔ͨ͠

    View full-size slide

  6. 4FOTF)"5ͷػೳͱՁ֨
    • ͍Ζ͍Ζ͍ͭͯΔ
    – YϑϧΧϥʔ-&%
    – δϣΠεςΟοΫ
    – <Թ࣪౓ ؾѹ ֯౓ Ճ଎౓ ํҐ>ηϯαʔ
    • ԁ͘Β͍
    – 34ΦϯϥΠϯͱ͔Ͱങ͑Δ͸ͣ
    – Θͨ͠͸ͳΜ͔)FZࣾࣾ௕͔Β΋Βͬͨ

    View full-size slide

  7. -&%Ͱ͋ͦ΅͏
    • YϑϧΧϥʔ-&%Λ͍͍ײ͡ʹޫΒͤΔ
    • -&%͚ͩͷϞδϡʔϧ͸1JNPSPOJ͔Β
    6OJDPSO)"5͕ൃച͞Ε͍ͯΔ

    View full-size slide

  8. ೔ຊͷࠓͷఱؾΛදࣔ͠Α͏
    • YͰ೔ຊ஍ਤΛදݱͯ͠ɺ֤஍ͷݱࡏͷ
    ͓ఱؾΛදࣔ͢ΔϓϩάϥϜ
    – ஍఺͘Β͍
    • 0QFO8FBUIFS.BQͷ"1*Λར༻͢Δ
    – ແྉΞΧ΢ϯτΛར༻
    – 1ZUIPOͷϥΠϒϥϦ͕͋ͬͨͷͰར༻
    • ιʔείʔυ͸(JUIVCʹ͓͍ͨ
    – IUUQHJUIVCDPN"LLJFTPGU31JUPPMT

    View full-size slide

  9. ͜Μͳ͔Μ͡
    • ೔ຊʜʜʁ

    View full-size slide

  10. ৭ͷ࢖͍෼͚
    • ΦϨϯδ੖Ε
    • άϨʔʢനʁʣ͘΋Γ
    • ੨Ӎ
    • ਫ৭ઇ

    View full-size slide

  11. ΋͔͍ͬ
    • ͪͳΈʹࠨ্͸ԭೄ

    View full-size slide

  12. ؾѹܭͰ༡ΜͰΈΑ͏
    • ஋͸ϛϦόʔϧϔΫτύεΧϧͰऔಘ
    Ͱ͖Δ
    • ؾѹ͸ఱؾͱ͔ߴ௿ࠩͰ஋͕มΘΔ͸ͣ
    • Φοʂࠓ೔͸ొࢁͰ͢Ͷ
    • ຊް໦͘Β͍͔Β͜͜·ͰͷؾѹΛه࿥
    ͯ͠Έͨ
    – ͦ͜·Ͱ͸ίʔυॻ͍ͯDSPOʹొ࿥ͯͨ͠

    View full-size slide

  13. εΫϦϓτ
    from  sense_hat  import  SenseHat
    import  datetime
    d  =  datetime.datetime.now()
    now  =  "{0:%Y-­‐%m-­‐%d,%H:%M:%S}".format(d)
    if  __name__  ==  "__main__":
    sense  =  SenseHat()
    pressure  =  sense.get_pressure()
    pressure  =  round(pressure,  1)
    print(now  +  ","  +  str(pressure))

    View full-size slide

  14. DSPOͰ෼͝ͱʹه࿥
    • DSPOʹॻ͘
    • DTW͸͜Μͳײ͡Ͱग़ͯ͘Δ
    *  *  *  *  *  /usr/bin/python /home/pi/pressure.py  ¥
    >>  /home/pi/pressure.csv
    2017-­‐02-­‐18,12:41:02,1000.6
    2017-­‐02-­‐18,12:42:02,997.6

    View full-size slide

  15. άϥϑ
    920
    930
    940
    950
    960
    970
    980
    990
    1000
    1010
    1020
    11:11:02
    11:15:02
    11:19:02
    11:23:01
    11:27:02
    11:31:01
    11:35:02
    11:39:01
    11:43:02
    11:47:01
    11:51:02
    11:55:01
    11:59:02
    12:03:01
    12:07:02
    12:11:01
    12:15:02
    12:19:01
    12:23:02
    12:27:01
    12:31:02
    12:35:01
    12:39:02
    12:43:01
    12:47:02
    12:51:02
    12:55:02
    12:59:02
    13:03:02
    13:07:02
    13:11:02
    13:15:02
    13:19:02
    13:23:02
    13:27:02
    13:31:02
    13:35:02
    13:39:02
    13:43:02
    13:47:02
    13:55:01
    13:59:02
    14:03:01
    14:07:02
    14:11:02
    14:15:02
    14:19:02
    タイトル

    View full-size slide

  16. άϥϑͷղઆ
    920
    930
    940
    950
    960
    970
    980
    990
    1000
    1010
    1020
    11:11:02
    11:15:02
    11:19:02
    11:23:01
    11:27:02
    11:31:01
    11:35:02
    11:39:01
    11:43:02
    11:47:01
    11:51:02
    11:55:01
    11:59:02
    12:03:01
    12:07:02
    12:11:01
    12:15:02
    12:19:01
    12:23:02
    12:27:01
    12:31:02
    12:35:01
    12:39:02
    12:43:01
    12:47:02
    12:51:02
    12:55:02
    12:59:02
    13:03:02
    13:07:02
    13:11:02
    13:15:02
    13:19:02
    13:23:02
    13:27:02
    13:31:02
    13:35:02
    13:39:02
    13:43:02
    13:47:02
    13:55:01
    13:59:02
    14:03:01
    14:07:02
    14:11:02
    14:15:02
    14:19:02
    タイトル
    箱根湯本で
    散歩と昼飯
    秦野近辺で
    なぜか落ちる
    小田原〜箱根湯本
    ホテルの手前の坂
    宮ノ下駅着
    箱根湯本発
    スイッチバック
    &信号停止

    View full-size slide

  17. 4FOTF)"5খωλ
    • Թ౓ηϯαʔ͸3BTQCFSSZ1Jຊମͷ೤Λ
    रͬͯ͠·ͷͰਫ਼౓Ҏલͷ໰୊͕͋Δɺ
    Β͍͠ɻ
    – 1JͳΒͳ͓͞ΒͩΑͶʜʜʂ
    – έʔϒϧͱ͔Ͱ৳͹͢ͷ͕٢

    View full-size slide

  18. ·ͱΊ
    • 4FOTF)"5͸༡΂Δ
    • -&%ϐΧϐΧɺώΧϦϞϊ͸ΠΠͧ
    • ؾѹܭͷਫ਼౓͸Θ͔Βͳ͍͚Ͳ·͋ొࢁ
    ͨ͜͠ͱ͸Θ͔ͬͨ
    – ϗςϧલͷࡔ͍͢͝ʜʜ
    • ࣍͸δϣΠεςΟοΫͰ༡ͼ͍ͨͳʁ

    View full-size slide

  19. ͓·͚Լࢁ෼ͷؾѹάϥϑ
    930
    940
    950
    960
    970
    980
    990
    1000
    1010
    1020
    1030
    9:04:01
    9:09:02
    9:14:01
    9:19:02
    9:24:01
    9:29:02
    9:34:02
    9:39:01
    9:44:02
    9:49:01
    9:54:02
    9:59:02
    10:04:01
    10:09:02
    10:14:02
    10:19:01
    10:24:02
    10:29:01
    10:34:02
    10:39:02
    10:44:01
    10:49:02
    10:54:02
    10:59:01
    11:04:02
    11:09:02
    11:14:02
    11:19:02
    11:24:01
    11:29:02
    11:34:01
    11:39:02
    11:44:02
    11:49:01
    11:54:02
    11:59:02
    12:04:01
    12:09:02
    12:14:02
    12:19:02
    12:24:02
    タイトル
    スイッチバック
    信号停止
    ホテルの坂
    宮ノ下駅の坂 登山電車
    箱根湯本
    〜小田原 町田着
    相模大野着
    秦野

    View full-size slide