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

iOS * BLE簡単プロトタイピング

iOS * BLE簡単プロトタイピング

iOS * BLE簡単プロトタイピング

2bfe6788efad92edfd2a1961aebf243f?s=128

takahiroyamamoto

April 02, 2015
Tweet

Transcript

  1. J04✖️#-& ؆୯ϓϩτλΠϐϯά XJUI4XJGU✖️#-&4FSJBM✖️NCFE ࢁຊɹګେ 5BLBIJSP:".".050 גࣜձࣾχίϯγεςϜ 

  2. ࣗݾ঺հ w ࢁຊɹګେ w ͓࢓ࣄ w גࣜձࣾχίϯγεςϜ w Χϝϥ༻ΞϓϦͷ.BD൛ͷ։ൃ 

    ࠓ೔ͷൃද͸ۀ຿ͱ͸ ؔ܎ͳ͠
  3. എܠ εϚϗΤϯδχΞ࿮ͰࢀՃͨ͠ϋοΧιϯ ͜ͷΞΠσΞɺ ͳΜ͔σόΠε࡞ͬͨํ͕੝Γ্͕ΔΑͶʁ 0,ʂ ͡Ό͋ɺԶ࡞ΔΘʢυϠإʣ

  4. ׬੒౓͕௿͍ͬ͢ɻ ϓϨθϯͰޡຐԽͯ͠ Ͱ΋ɺ݁ہ ͲΜ·͍ ͱ͔

  5. पลσόΠε΋࡞Εͳ͍͔ͳʁ ͍΍ɺ ࠓճ͸ΞϓϦ͚ͩͰউෛ͠Α͏ ࠷ॳ͔ΒఘΊͯͨΓɻɻɻ

  6. ͘΍͍͠ʂʂ

  7. IUUQTXXXBQQMFDPNXBUDI IUUQKBXJLJQFEJBPSHXJLJ(PPHMF@(MBTT ϓϩτλΠϓ͍ͨ͠΋ͷ  ΢ΣΞϥϒϧσόΠεͱ͔ɺ εϚϗ͔ΒपลσόΠε੍ޚͨ͠Γɺ ηϯαͷσʔλऔΓग़͍ͨ͠

  8. NCFE J1IPOF #-& IUUQKBXJLJQFEJBPSHXJLJ*1IPOF IUUQXXXSPCPUTGYDPNSPCPU#-&4FSJBMIUNM IUUQKBXJLJQFEJBPSHXJLJ.CFE

  9. #-&ҙ֎ͱେม 

  10.  NCFE J1IPOF IUUQKBXJLJQFEJBPSHXJLJ*1IPOF ("55 "55 -$"1 ("1 #-&ϓϩτίϧελοΫ MJOLMBZFS

    -&QIZTJDBM Bluetooth SIG ӳޠ Q͘Β͍ͷࢿྉ IUUQKBXJLJQFEJBPSHXJLJ.CFE
  11. େมʂʂ ͳΒɺͦ͜͸࡞Βͳ͍

  12. NCFE J1IPOF  ϥΠϒϥϦ #-&4FSJBM #-&ϓϩτίϧ ϒϥοΫϘοΫε 6"35 IUUQKBXJLJQFEJBPSHXJLJ.CFE IUUQKBXJLJQFEJBPSHXJLJ*1IPOF

  13. #-&4FSJBM IUUQXXXSPCPUTGYDPNSPCPU#-&4FSJBMIUNM ɾ6"35ͰಡΈॻ͖͢Δ͚ͩͰ#-&௨৴ ɾ#-&ͷ஌ࣝෆཁ ɾ#-&ͷେมͳ෦෼͸શͯϞδϡʔϧଆ͕୲౰ ɾ=ʢ੫ࠐʣ 

  14. ϥΠϒϥϦ ɾDPSF#MVFUPPUIϥούʔϥΠϒϥϦ  DPSF#MVFUPPUI ɾ༗໊Ͳ͜Ζ ɹɹɾ:NT$PSF#MVFUPPUI ɹɹɾ-(#MVFUPPUI ӳޠɺPCKFDUJWFD ϥούʔϥΠϒϥϦ #-&4FSJBM༻ϥΠϒϥϦ

  15. ϥΠϒϥϦ IUUQTHJUIVCDPN5BLBIJSP:BNBNPUP#-&4FSJBM TXJGU೔ຊޠͰ࡞ͬͯΈͨ 

  16. ϥΠϒϥϦ w "1* w DPOOFDU w EJTDPOOFDU w SFBE#MPDL w

    XSJUF Ҏ্ʂʂ 
  17. σϞ

  18. None
  19. ίʔυʢJ04ଆʣ  @IBAction func prev(sender:AnyObject) //લਐϘλϯ { var communicator :

    BLECommunicator = BLECommunicator.sharedInstance communicator.write("a") } @IBAction func back(sender:AnyObject) //ޙୀϘλϯ { var communicator : BLECommunicator = BLECommunicator.sharedInstance communicator.write("z") } @IBAction func rotate(sender:AnyObject) //ճసϘλϯ { var communicator : BLECommunicator = BLECommunicator.sharedInstance communicator.write("r") } @IBAction func stop(sender:AnyObject) //ఀࢭϘλϯ { var communicator : BLECommunicator = BLECommunicator.sharedInstance communicator.write("o") }
  20. if(SciByteRx(&data) > 0){ { if(data == ‘a’)//લਐॲཧ { //લਐ }

    else if(data == ‘z’)//ޙୀ { //ޙୀ } else if(data == ‘r’)//ճస { //ճస } else { //ఀࢭ } } } ίʔυ σόΠεଆ
  21. ίʔυ GetEncoder(&right_b,&left_b); char str[256]; sprintf(str,"r:%d,l:%d",right_b - right , left_b -

    left); communicator.readBlock = {string in } J04ଆ σόΠεଆ
  22. ·ͱΊ w J04ͱपลσόΠεΛ#-&ͷ஌ࣝͳ͠Ͱܨ͛·͢ʂ w ϥΠϒϥϦ࢖ͬͯ΋Β͑ͨΒخ͍͠Ͱ͢ w ϓϧϦΫͱ͔΋Β͑ͨΒ΋ͬͱخ͍͠Ͱ͢ w ԹઘϋοΧιϯ୭͔Ұॹʹग़·ͤΜ͔ʁ w

    IUUQTQBKBNKQ