Slide 1

Slide 1 text

ՈʹؼΔͱऊ೤஍ࠈͳͷΛ ͳΜͱ͔͢Δ ߹ಉษڧձJOେ౎ձԬࢁ4VNNFS

Slide 2

Slide 2 text

͓·͑ͩΕʁ ‣ @mu2in ‣ Java7ΤϯδχΞ4೥໨ ‣ ޷͖ͳϓϩάϥϛϯάݴޠɿJavaScript ‣ ࢀՃίϛϡχςΟ ▹ ͍͢͝޿ౡ ओ࠵ ▹ PyCon mini Hiroshima 2018 ▹ Φʔϓϯηϛφʔ޿ౡ 2019 ࣮ߦҕһ௕ ‣ ࠷ۙɺ׆ಈࣗॗத …

Slide 3

Slide 3 text

ࠓճͷՐ෇͚໾

Slide 4

Slide 4 text

ͳΜͱ͔͠Α͏

Slide 5

Slide 5 text

߹ಉษڧձJOେ౎ձԬࢁ4VNNFS ࠷ۙ࿩୊ͷPCOJ[Λ࢖ͬͯ ֶशϦϞίϯΛ࡞ͬͯΈͨ

Slide 6

Slide 6 text

PCOJ[ͱ͸ • ࠷ۙ࿩୊ͷIoTϚΠίϯ • ϑΝʔϜ΢ΣΞϨε • JavaScriptͰ؆୯ʹૢ࡞Ͱ͖Δ • ೔ຊͷ CambrianRobotics
 ͱ͍͏ձ͕ࣾ࡞ͬͯΔ • KickStarterͰങͬͨ ¥3,400

Slide 7

Slide 7 text

ηοτΞοϓ Wi-Fiʹͭͳ͙ ηϯαʔʹͭͳ͙ ίʔυΛॻ͘

Slide 8

Slide 8 text

੺֎ઢLEDΛͭͳ͍ͰΈΔ

Slide 9

Slide 9 text

͍͍ͩͨ20ߦ͘Β͍ॻ͘

Slide 10

Slide 10 text

JavaScript ͷ෦෼ var obniz = new Obniz(“OBNIZ_ID_HERE”); obniz.onconnect = async function () { led = obniz.wired(“InfraredLED”, { anode:1, cathode:0 } ); document.querySelector(“#on”).addEventListener(“click”, function (){ led.send([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, obniz.display.clear(); obniz.display.print(“ΤΞίϯΦϯ”); }); document.querySelector(“#off”).addEventListener(“click”, function (){ led.send([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, obniz.display.clear(); obniz.display.print(“ΤΞίϯΦϑ”); }); };

Slide 11

Slide 11 text

εϚϗ͔ΒΤΞίϯૢ࡞

Slide 12

Slide 12 text

Ϳָͪ͡ΌΖ ޿ౡห

Slide 13

Slide 13 text

εϚʔτεϐʔΧʔͱ࿈ܞ

Slide 14

Slide 14 text

γεςϜߏ੒ ΤΞίϯ͚ͭͯ

Slide 15

Slide 15 text

Webhook Λઃఆ

Slide 16

Slide 16 text

JavaScript Λগ͠มߋ var obniz = new Obniz(“OBNIZ_ID_HERE”); obniz.onconnect = async function () { led = obniz.wired(“InfraredLED”, { anode:1, cathode:0 } ); if (typeof req === “object”) { await obniz.wait(500); if(req.body.aircon) { led.send([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, obniz.display.clear(); obniz.display.print(“ΤΞίϯΦϯ”); await obniz.wait(3000); } else { led.send([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, obniz.display.clear(); obniz.display.print(“ΤΞίϯΦϑ”); await obniz.wait(3000); } } if (typeof done === “function”) { done(); } };

Slide 17

Slide 17 text

IFTTT Ͱ Webhook ͱ࿈ܞ

Slide 18

Slide 18 text

εϚʔτεϐʔΧʔ͔ΒΤΞίϯૢ࡞ ΤΞίϯ͚ͭͯ

Slide 19

Slide 19 text

·ͱΊ • obnizͰ؆୯IoT • webܥͷਓʹ΋Φεεϝ • αϙʔτ͕΍͍͞͠ • Ḑ೤஍ࠈ → ྫྷ๪ఱࠃ • ϋϯζΦϯ΋΍ͬͯΔΒ͍͠