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

NodeJSで現実世界のものを動かす話

179d41d0fdd38c6980de9f2ae0e4768a?s=47 kido
October 30, 2018

 NodeJSで現実世界のものを動かす話

NodeJSで現実世界のものを動かす話
Raspberry Pi, arduino, obniz, Clova

179d41d0fdd38c6980de9f2ae0e4768a?s=128

kido

October 30, 2018
Tweet

More Decks by kido

Other Decks in Technology

Transcript

  1. NODE.JSͰ ݱ࣮ੈքͷ”΋ͷ”Λಈ͔͢࿩ ໦ށɹtwitter:@9wick

  2. ࣗݾ঺հ Kohei Kido (twitter:@9wick) ϋʔυ΢ΣΞˍιϑτ΢ΣΞΤϯδχΞ
 NHKϩϘίϯɼiPhoneΞϓϦɼWebαʔϏε (ג)CambrianRobotics Node.JSྺ : 1೥͙Β͍

    express৮ͬͯΔ (vue.jsษڧத)
 Javascriptྺ͸௕Ίɹ(ະͩʹJQuery͔Βൈ͚ग़ͤͯͳ͍)
  3. ࣗݾ঺հ Kohei Kido (twitter:@9wick) ϋʔυ΢ΣΞˍιϑτ΢ΣΞΤϯδχΞ
 NHKϩϘίϯɼiPhoneΞϓϦɼWebαʔϏε (ג)CambrianRobotics Node.JSྺ : 1೥͙Β͍

    express৮ͬͯΔ (vue.jsษڧத)
 Javascriptྺ͸௕Ίɹ(ະͩʹJQuery͔Βൈ͚ग़ͤͯͳ͍) NodeֶԂɼॳࢀՃͰॳొஃͰ͢
 ※ͱΓ͋͑ͣൃදͯ͠ΈΔελΠϧ
  4. લճͷΠϕϯτ ࠓճͷΠϕϯτ ↑͜Ε͙Β͍ͷதʹฆΕΔ͜ͱΛ૝૾͍ͯͨ͠

  5. NODEJS/JAVASCRIPTͷྖҬ͕ ೥ʑ޿͕ͬͯΔ ػցֶश ϑϩϯτΤϯυ Webαʔόʔ εϚϗΞϓϦ σεΫτοϓΞϓϦ υϩʔϯ

  6. NODE.JSͰͰ͖Δ͜ͱ CLIΞϓϦέʔγϣϯ
 Hello, world! Webαʔόʔ
 HTTP request / response 


  7. NODE.JSͰͰ͖Δ͜ͱ CLIΞϓϦέʔγϣϯ
 Hello, world! Webαʔόʔ
 HTTP request / response 


    จࣈ͚ͩɹˠɹ1࣍ݩ UI͕࡞ΕΔɹˠɹ2࣍ݩ
  8. NODE.JSͰͰ͖Δ͜ͱ CLIΞϓϦέʔγϣϯ
 Hello, world! Webαʔόʔ
 HTTP request / response ݱ࣮ੈքͷ”΋ͷ”ͷϓϩάϥϜ


    ϋʔυ΢ΣΞϓϩάϥϜ จࣈ͚ͩɹˠɹ1࣍ݩ UI͕࡞ΕΔɹˠɹ2࣍ݩ ݱ࣮͕ಈ͘ɹˠɹ3࣍ݩ
  9. 2࣍ݩ͔Β3࣍ݩ΁

  10. “΋ͷ”Λಈ͔ͤΔͱԿ͕Ͱ͖Δ͔ ݱ࣮ʹׯবͰ͖Δ ೖྗ ԻɾԹ౓ɾ܏͖ɾ౔৕ɾۭؾ ग़ྗ ޫɾԻɾϞʔλʔɾిޫܝࣔ൘ɾϩϘοτ

  11. NODE.JSͰಈ͔ͤΔσόΠε Raspberry Pi
 ϥζϕϦʔύΠ arduino
 ΞϧσΟʔϊ obniz 
 ΦϒφΠζ

  12. RASPBERRY PIʢϥζϕϦʔύΠʣ খ͍͞PC Nodejs͕ಈ͘ʢPCͳͷͰʣ IO୺ࢠ͕͍͍ͭͯΔ

  13. ARDUINOʢΞϧσΟʔϊʣ PCͰ͸ͳ͘ϚΠίϯ Nodejs͸ಈ͔ͳ͍ʢPC͡Όͳ͍ͷͰʣˠ PCͰಈ͔͢ ༗ઢ઀ଓ / IO୺ࢠ͕͋Δ ίϚϯυͷ΍ΓऔΓ

  14. OBNIZ ʢΦϒφΠζʣ ϚΠίϯʁ Nodejs͸ಈ͔ͳ͍ʢPC͡Όͳ͍ͷͰʣˠαʔόʔͰಈ͔͢ ແઢ઀ଓ / IO୺ࢠ͕͋Δ Πϯλʔωοτ

  15. NODEJS͕ಈ͘৔ॴҧ͍·ͱΊ Πϯλʔωοτͷน

  16. αʔόʔ͔Βಈ͔ͤΔͱ ԕִ஍͔Βಈ͔ͤΔ ଞγεςϜͷҰ෦ͱͯ͠࢖͑Δ εϚʔτεϐʔΧʔ AI

  17. ͱ͍͏Θ͚Ͱ࡞ͬͨ΋ͷ

  18. ϑϩʔਤ obniz on Clova ʮલʹਐΊʯ obnizͱ઀ଓ ઀ଓ׬ྃ “motor move“Λ
 “io0

    5V"ʹม׵ ίϚϯυड৴ io0Λ5Vʹ͢Δ ಈ͘ Ϩεϙϯεฦ͢ “io0 5V”Λૹ৴ ʮલʹਐΈ·͢ʯ σόΠε Ի੠Λղੳͯ͠
 httpϦΫΤετૹ৴ σόΠεʹૹ৴ HTTPϦΫΤετΛղੳ ෦඼
  19. ੡࡞෺ৄࡉ͸࠙਌ձͰ
 ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠