<p><span style="background-color: #ffffff; color: #454545; font-family: Raleway, Arial, sans-serif; font-size: 24px; letter-spacing: 1px;">비컨 DIY와 활용: 미아방지 목걸이 만들기</span></p>
<div class="entry-content" style="box-sizing: inherit; margin: 1.5em 0px 0px; color: #505050; font-family: Lato, Verdana, sans-serif; font-size: 14px; background-color: #ffffff;">
   <p style="box-sizing: inherit; margin-bottom: 10px;">비컨 관련된 기술이, 그 중 특히 iBeacon이 근래들어 주목을 받긴 했지만 아직 일반에 보급되진 못하고 있습니다. 대기업을 포함한 여러 IT 업체들이 사전 작업을 하고 있지만 가시적인 움직임은 아직 지지부진 합니다. 주변에 깔린 비컨 기기도 거의 없구요. 그래서 더욱 메이커가 도전해 볼만한 분야가 아닌가 합니다.</p>
   <p style="box-sizing: inherit; margin-bottom: 10px;">비컨은 굉장히 간단한 기술이라 비교적 쉽게 활용할 수 있는 기술입니다. Bluetooth Low Energy를 활용해서 UUID, Major, Minor 등등 비컨 기기의 고유 ID와 카테고리 전송파워와 같은 정보를 주변에 broadcast 해줄 뿐입니다. 이걸 휴대폰 앱에서 받아서 원하는 처리를 하면 됩니다. 비컨을 활용해서 어떤 서비스를 만들 것인가에 대한 아이디어가 중요합니다.</p>
   <p style="box-sizing: inherit; margin-bottom: 10px;">여기서는 비컨 기기를 직접 만들고 활용하는 방법에 대해서 적어보려고 합니다. iBeacon을 지원하는 BLE(Bluetooth Low Energy) 모듈을 이용해서 비컨을 만들고 만든 비컨을 목걸이 형태로 제작해서 ‘미아방지 목걸이’로 활용하는 방법입니다.</p>
   <p style="box-sizing: inherit; margin-bottom: 10px;">&nbsp;</p>
   <h1 style="box-sizing: inherit; margin: 20px 0px 10px; font-size: 28px; font-family: Raleway, Arial, sans-serif; line-height: 1; color: #454545; clear: both;"><strong style="box-sizing: inherit;">1. 비컨 만들기 준비물</strong></h1>
   <h4 style="box-sizing: inherit; font-family: Raleway, Arial, sans-serif; line-height: 1; color: #454545; margin: 15px 0px 10px; font-size: 18px; clear: both;"><strong style="box-sizing: inherit;"># BLE 모듈</strong></h4>
   <p style="box-sizing: inherit; margin-bottom: 10px;">Ebay, Aliexpress 등에서 ‘ibeacon module’로 검색하면 각종 iBeacon 모듈들을 보실 수 있습니다. 제가 사용한 BLE 모듈은 아래와 같습니다.</p>
   <p style="box-sizing: inherit; margin-bottom: 10px;"><a href="http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/09/ble_12.jpg" style="box-sizing: inherit; background-color: transparent; color: #009688; text-decoration-line: none; transition: color 0.35s ease 0s;" target="_blank"><img class="alignnone wp-image-1092 size-medium" src="http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/09/ble_12-300x300.jpg" alt="ble_12" width="300" srcset="http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/09/ble_12-300x300.jpg 300w, http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/09/ble_12-150x150.jpg 150w, http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/09/ble_12-100x100.jpg 100w, http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/09/ble_12.jpg 500w" sizes="(max-width: 300px) 100vw, 300px" style="box-sizing: inherit; border: 0px; vertical-align: middle; max-width: 100%; height: auto; margin-top: 20px; margin-bottom: 20px;" /></a></p>
   <p style="box-sizing: inherit; margin-bottom: 10px;"><span style="box-sizing: inherit; color: #000000;">TI-CC2540 칩을 사용하고 HM-10 모듈로 판매되는 제품과 호환됩니다. 원래 목적은 BLE 통신용이지만 최신 펌웨어에서&nbsp;iBeacon 모드를 지원하기 때문에 비컨으로 활용하실 수 있습니다. [</span><strong style="box-sizing: inherit;"><a href="http://www.ebay.com/itm/231189452585?_trksid=p2059210.m2749.l2649&amp;ssPageName=STRK%3AMEBIDX%3AIT" target="_blank" data-cke-saved-href="http://www.ebay.com/itm/231189452585?_trksid=p2059210.m2749.l2649&amp;ssPageName=STRK%3AMEBIDX%3AIT" style="box-sizing: inherit; background-color: transparent; color: #0782c1; text-decoration-line: none; transition: color 0.35s ease 0s;"><span style="box-sizing: inherit; color: #000000;">링크</span></a></strong><span style="box-sizing: inherit; color: #000000;">]로 가시면 제품에 대한 상세 스펙과 가격을 확인하실 수 있습니다. 아직 제품이 많이 사용되지는 않아서인지 가격이 15$ 내외에 형성되어 있습니다.(HM-10으로 검색하시면 훨씬 저렴한 모듈들도 많습니다.)</span></p>
   <p style="box-sizing: inherit; margin-bottom: 10px;"><span style="box-sizing: inherit; color: #000000;">위 사진에서 보시다시피 모듈이 인터페이스 보드에 붙어있는 제품을 사시는 것이 처음에 테스트 할 때는 편하실겁니다. 충분히 테스트를 마치고나면 인터페이스 보드 제거하고 사용하시면 됩니다. (대신 3.3v 전원을 사용해야하고 납땜이 굉장히 어렵습니다)</span></p>
   <p style="box-sizing: inherit; margin-bottom: 10px;"><span style="box-sizing: inherit; color: #000000;">• BT Version: Bluetooth Specification V4.0 BLE</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• Send and receive no bytes limit</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• Working frequency: 2.4GHz ISM band</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• Modulation method: GFSK(Gaussian Frequency Shift Keying)</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• RF Power: 0.01mw-5mw, can modify through AT&nbsp;</span><span style="box-sizing: inherit; color: #000000;">Command</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• Speed: Asynchronous: 6K Bytes, Synchronous: 6K Bytes</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• Security: Authentication and encryption</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• Service: Central &amp; Peripheral UUID FFE0,FFE1</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• Power: +3.3VDC 50mA</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• Open space have 100 Meters with iphone4s</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• Power: In sleep mode 400uA~1.5mA, Active mode 8.5mA.</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• Working temperature:–5 ~ +65 Centigrade</span><br style="box-sizing: inherit; color: #6e6e6e;" /><span style="box-sizing: inherit; color: #000000;">• Dimension: 26.9mm x 13mm x 2.2mm</span></p>
   <h4 style="box-sizing: inherit; font-family: Raleway, Arial, sans-serif; line-height: 1; color: #454545; margin: 15px 0px 10px; font-size: 18px; clear: both;"><a href="http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/10/hm_10.png" style="box-sizing: inherit; background-color: transparent; color: #454545; text-decoration-line: none; transition: color 0.35s ease 0s;" target="_blank"><img class="alignnone size-full wp-image-1124" src="http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/10/hm_10.png" alt="hm_10" width="565" srcset="http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/10/hm_10.png 565w, http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/10/hm_10-300x165.png 300w" sizes="(max-width: 565px) 100vw, 565px" style="box-sizing: inherit; border: 0px; vertical-align: middle; max-width: 100%; height: auto; margin-top: 20px; margin-bottom: 20px;" /></a></h4>
   <p style="box-sizing: inherit; margin-bottom: 10px;">&nbsp;</p>
   <h4 style="box-sizing: inherit; font-family: Raleway, Arial, sans-serif; line-height: 1; color: #454545; margin: 15px 0px 10px; font-size: 18px; clear: both;"><strong style="box-sizing: inherit;"># 코인 배터리</strong></h4>
   <p style="box-sizing: inherit; margin-bottom: 10px;">BLE 자체가 저전력 블루투스 이므로 코인 배터리로도 1~2년의 동작시간을 확보할 수 있도록 설계되어 있습니다.&nbsp;제가 사용한 BLE 모듈은 auto sleep 모드에서 평균 0.18mA의 전력을 소비합니다. 알카라인 전지 3개가 1800mAh 라고 가정하면 약 10,000 시간을 버틸 수 있고, 1년이 넘게 사용 가능합니다. 크기를 위해 240mAh CR2032 코인 전지를 사용하면 약 55일을 사용할 수 있습니다. 아래 가이드대로&nbsp;&nbsp;iBeacon 전용 모드로 설정할 경우 소비전력이 좀 더 줄어서 더 오래갈 것으로 예상합니다.</p>
   <h4 style="box-sizing: inherit; font-family: Raleway, Arial, sans-serif; line-height: 1; color: #454545; margin: 15px 0px 10px; font-size: 18px; clear: both;"><strong style="box-sizing: inherit;"># 코일 배터리 홀더</strong></h4>
   <p style="box-sizing: inherit; margin-bottom: 10px;">코인배터리를 적당히 고정시킬 수 있는 홀더를 구매하거나 만듭니다.</p>
   <p style="box-sizing: inherit; margin-bottom: 10px;">&nbsp;</p>
   <h1 style="box-sizing: inherit; margin: 20px 0px 10px; font-size: 28px; font-family: Raleway, Arial, sans-serif; line-height: 1; color: #454545; clear: both;"><strong style="box-sizing: inherit;">2. 비컨 만들기</strong></h1>
   <p style="box-sizing: inherit; margin-bottom: 10px;">BLE 모듈을 구하시면 먼저 비컨 기기로 바꾸는 과정을 거쳐야 합니다.&nbsp;<span style="box-sizing: inherit; color: #ff0000;"><strong style="box-sizing: inherit;">AT command</strong></span>&nbsp;라고 부르는 명령어를 serial 통신으로 전송하면 블루투스 모듈 내부 설정을 변경할 수 있습니다.</p>
   <p style="box-sizing: inherit; margin-bottom: 10px;"><strong style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #ff0000;">주의!! :</span><span style="box-sizing: inherit; color: #000000;">&nbsp;BLE 모듈을 iBeacon으로 바꿔주는 AT command 는 최신 펌웨어에서 제공합니다. 따라서 모듈을 구매하실 때 iBeacon 모드를&nbsp;지원하는지 seller 에게 문의해 보는 것이 좋습니다. 2014년 9월 최신 펌웨어 버전은 v531 입니다. 문서상으로 볼 때 v529 (14년 6월) 이상이 되어야 할 듯 합니다.</span></strong></p>
   <p style="box-sizing: inherit; margin-bottom: 10px;">AT command를 보내는 방법은 여러가지가 있는데.. FTDI(USB to UART) 모듈을 통해서 PC와 연결한 뒤 PC에서 전용 프로그램으로 할 수 있고, 블루투스로&nbsp;<a href="http://www.jnhuamao.cn/showNews.asp?id=63" target="_blank" style="box-sizing: inherit; background-color: transparent; color: #009688; text-decoration-line: none; transition: color 0.35s ease 0s;"><strong style="box-sizing: inherit;">휴대폰 앱과 연결</strong></a>해서 앱에서도 가능합니다. 여기서는 아두이노를 이용해서 AT command를 전송하고 설정을 변경해 보겠습니다.</p>
   <p style="box-sizing: inherit; margin-bottom: 10px; color: #525252;"><span style="box-sizing: inherit; color: #000000;">아두이노는 PC와 연결된 상태에서(USB serial 로) D2, D3 핀을 이용해서 블루투스 모듈과 연결합니다. 그리고 블루투스 모듈과의 통신은 SoftwareSerial을 사용합니다.</span></p>
   <p style="box-sizing: inherit; margin-bottom: 10px; color: #525252;"><strong style="box-sizing: inherit;">연결방법 :</strong>&nbsp;(<strong style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #ff0000;">아두이노&nbsp;</span>-&gt; BLE 모듈</strong>)&nbsp;<strong style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #ff0000;">D2&nbsp;</span>-&gt; TX, &nbsp;<span style="box-sizing: inherit; color: #ff0000;">D3&nbsp;</span>-&gt; RX, &nbsp;<span style="box-sizing: inherit; color: #ff0000;">5V&nbsp;</span>-&gt; VCC, &nbsp;<span style="box-sizing: inherit; color: #ff0000;">GND&nbsp;</span>-&gt; GND</strong></p>
   <p style="box-sizing: inherit; margin-bottom: 10px; color: #525252;"><span style="box-sizing: inherit; color: #000000;">만약 인터페이스 보드 없는 HM-10 모듈을 사용하신다면 아래 이미지를 참고하셔서 연결하세요.</span></p>
   <p style="box-sizing: inherit; margin-bottom: 10px; color: #525252;"><a href="http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/10/hm_10_conn.png" style="box-sizing: inherit; background-color: transparent; color: #009688; text-decoration-line: none; transition: color 0.35s ease 0s;" target="_blank"><img class="alignnone wp-image-1123 size-full" src="http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/10/hm_10_conn.png" alt="hm_10_conn" width="579" srcset="http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/10/hm_10_conn.png 579w, http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/10/hm_10_conn-300x201.png 300w, http://www.hardcopyworld.com/ngine/aduino/wp-content/uploads/sites/3/2014/10/hm_10_conn-90x60.png 90w" sizes="(max-width: 579px) 100vw, 579px" style="box-sizing: inherit; border: 0px; vertical-align: middle; max-width: 100%; height: auto; margin-top: 20px; margin-bottom: 20px;" /></a></p>
   <p style="box-sizing: inherit; margin-bottom: 10px; color: #525252;"><span style="box-sizing: inherit; color: #000000;">그리고 아두이노에 아래 소스코드를 올립니다.</span></p>
   <p style="box-sizing: inherit; margin-bottom: 10px;">&nbsp;</p>
   <div id="crayon-5cc29e31b4231085225143" class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" style="box-sizing: border-box; text-size-adjust: none; width: 747.5px; padding: 0px; margin: 12px 0px; font-family: Monaco, MonacoRegular, &quot;Courier New&quot;, monospace; height: auto; overflow: hidden !important; position: relative !important; direction: ltr !important; border-width: 1px !important; border-color: #999999 !important; border-style: solid !important; text-shadow: none !important; background: rgb(253, 253, 253) !important; font-size: 12px !important; line-height: 15px !important;">
      <div class="crayon-plain-wrap" style="box-sizing: inherit; background: 0px center; border: 0px; padding: 0px !important; margin: 0px !important; height: auto !important;"><textarea wrap="soft" class="crayon-plain print-no" data-settings="dblclick" readonly="" style="margin: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; color: #000000; overflow: hidden; height: 360px; padding-top: 0px; padding-right: 5px; padding-left: 5px; border-width: 0px; border-style: initial; border-color: initial; border-radius: 0px; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; width: 745.5px; resize: none; outline: none; position: absolute; opacity: 0; box-shadow: none; white-space: pre; overflow-wrap: normal; tab-size: 4; z-index: 0; font-size: 12px !important; line-height: 15px !important; font-family: Monaco, MonacoRegular, &quot;Courier New&quot;, monospace !important;"></textarea></div>
      <div class="crayon-main" style="box-sizing: inherit; background: 0px center; border: 0px; padding: 0px; margin: 0px; width: 745.5px; overflow: hidden; position: relative; z-index: 1;">
         <table class="crayon-table" style="box-sizing: inherit; margin-left: 0px; border-spacing: 0px !important; background: none !important; width: auto !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; border-width: initial !important; border-style: none !important; border-color: initial !important; padding: 0px !important; table-layout: auto !important;">
            <tbody style="box-sizing: inherit;">
               <tr class="crayon-row" style="box-sizing: inherit; background: 0px center; padding: 0px !important; border: none !important; vertical-align: top !important; margin: 0px !important;">
                  <td class="crayon-nums " data-settings="show" style="box-sizing: inherit; border-width: 0px; border-style: initial; border-color: initial; padding: 0px !important; vertical-align: top !important; margin: 0px !important; background: rgb(223, 239, 255) !important; color: #5499de !important;">
                     <div class="crayon-nums-content" style="box-sizing: inherit; background: 0px center; border: 0px; padding: 0px; margin: 0px; white-space: nowrap; line-height: 15px !important;">
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-1" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">1</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-2" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">2</div>
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-3" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">3</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-4" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">4</div>
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-5" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">5</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-6" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">6</div>
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-7" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">7</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-8" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">8</div>
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-9" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">9</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-10" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">10</div>
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-11" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">11</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-12" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">12</div>
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-13" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">13</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-14" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">14</div>
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-15" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">15</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-16" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">16</div>
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-17" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">17</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-18" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">18</div>
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-19" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">19</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-20" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">20</div>
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-21" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">21</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-22" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">22</div>
                        <div class="crayon-num" data-line="crayon-5cc29e31b4231085225143-23" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">23</div>
                        <div class="crayon-num crayon-striped-num" data-line="crayon-5cc29e31b4231085225143-24" style="box-sizing: inherit; font-family: inherit; background: rgb(200, 225, 250) !important; border: 0px; padding: 0px 5px; margin: 0px; text-align: center; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #317cc5 !important;">24</div>
                        </div>
                     </td>
                  <td class="crayon-code" style="box-sizing: inherit; border-width: 0px; border-style: initial; border-color: initial; background: 0px center; width: 720px; padding: 0px !important; vertical-align: top !important; margin: 0px !important;">
                     <div class="crayon-pre" style="box-sizing: inherit; padding: 0px; margin: 0px; white-space: pre; overflow: visible; tab-size: 4; background: none !important; border: none !important; line-height: 15px !important;">
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-1" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-p" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #b85c00 !important;">#include &lt;SoftwareSerial.h&gt;</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-2" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">&nbsp;</div>
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-3" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">SoftwareSerial </span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">mySerial</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-cn" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #ce0000 !important;">2</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">,</span><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"></span><span class="crayon-cn" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #ce0000 !important;">3</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">;</span><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"></span><span class="crayon-c" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #ff8000 !important;">// RX, TX</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-4" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">&nbsp;</div>
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-5" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-t" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #800080 !important;">void</span><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"></span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">setup</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-6" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">{</span></div>
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-7" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;</span><span class="crayon-c" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #ff8000 !important;">// Open serial communications and wait for port to open:</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-8" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;</span><span class="crayon-v" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #002d7a !important;">Serial</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">begin</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-cn" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #ce0000 !important;">9600</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">;</span></div>
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-9" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;</span><span class="crayon-v" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #002d7a !important;">Serial</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">println</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-s" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #008000 !important;">"Goodnight moon!"</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">;</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-10" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">&nbsp;</div>
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-11" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;</span><span class="crayon-c" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #ff8000 !important;">// set the data rate for the SoftwareSerial port</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-12" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;</span><span class="crayon-v" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #002d7a !important;">mySerial</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">begin</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-cn" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #ce0000 !important;">9600</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">;</span></div>
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-13" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">}</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-14" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">&nbsp;</div>
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-15" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-t" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #800080 !important;">void</span><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"></span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">loop</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"></span><span class="crayon-c" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #ff8000 !important;">// run over and over</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-16" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">{</span></div>
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-17" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;</span><span class="crayon-c" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #ff8000 !important;">// Receive from bluetooth and send it to PC</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-18" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;</span><span class="crayon-st" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #800080 !important;">if</span><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"></span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-v" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #002d7a !important;">mySerial</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">available</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span></div>
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-19" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-v" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #002d7a !important;">Serial</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">write</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-v" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #002d7a !important;">mySerial</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">read</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">;</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-20" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">&nbsp;</div>
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-21" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;</span><span class="crayon-c" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #ff8000 !important;">// Receive from PC and send it to bluetooth</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-22" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;</span><span class="crayon-st" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #800080 !important;">if</span><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"></span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-v" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #002d7a !important;">Serial</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">available</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span></div>
                        <div class="crayon-line" id="crayon-5cc29e31b4231085225143-23" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #006fe0 !important;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="crayon-v" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #002d7a !important;">mySerial</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">write</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-v" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #002d7a !important;">Serial</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #004ed0 !important;">read</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">(</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">;</span></div>
                        <div class="crayon-line crayon-striped-line" id="crayon-5cc29e31b4231085225143-24" style="box-sizing: inherit; font-family: inherit; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; background: rgb(247, 247, 247) !important; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;"><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: #333333 !important;">}</span></div>
                        </div>
                     </td>
                  </tr>
               </tbody>
            </table>
         </div>
      </div>
   <p style="box-sizing: inherit; margin-bottom: 10px;">&nbsp;</p>
   <p style="box-sizing: inherit; margin-bottom: 10px; color: #525252;"><span style="box-sizing: inherit; color: #000000;">소스를 보시면 아시겠지만 간단한 에코 시스템 만드는겁니다. USB를 통해 PC에서 받은 데이터를 BLE 모듈로 보내주고, BLE에서 받은 데이터는 PC로 보내주는 코드입니다. 이 코드를 컴파일해서 올리고&nbsp;<strong style="box-sizing: inherit;">[아두이노 IDE -&gt; 도구 -&gt;&nbsp;<span style="box-sizing: inherit; color: #ff0000;">시리얼 모니터</span>]</strong>&nbsp;를 실행하면 시리얼 모니터에 입력하는 값이 BLE로 전송되고 BLE에서 전송받은 데이터가 아래에 표시됩니다. 시리얼 모니터를 이용해서 AT Command를 전송하면 BLE 모듈을 설정할 수 있습니다.</span></p>
   <p style="box-sizing: inherit; margin-bottom: 10px; color: #525252;"><span style="box-sizing: inherit; color: #000000;">비컨이 정상적으로 설정되었는지 테스트 하기 위해서는 iBeacon 스캐너 앱이 필요합니다. 하드카피월드에서 제작한 아래 앱 다운로드 받고 사용하시면 됩니다.</span></p>
   <p style="box-sizing: inherit; margin-bottom: 10px; color: #525252;"><strong style="box-sizing: inherit;">Auto Beacon</strong>&nbsp;<strong style="box-sizing: inherit;"><a href="http://www.hardcopyworld.com/gnuboard5/bbs/board.php?bo_table=project_hardcopy&amp;wr_id=10" style="box-sizing: inherit; background-color: transparent; color: #000000; text-decoration-line: none; transition: color 0.35s ease 0s;" target="_blank">매뉴얼</a>,&nbsp;<a href="https://play.google.com/store/apps/details?id=com.wiredfactory.bluewave" style="box-sizing: inherit; background-color: transparent; color: #000000; text-decoration-line: none; transition: color 0.35s ease 0s;" target="_blank">앱 다운로드</a>&nbsp;</strong></p>
   <p style="box-sizing: inherit; margin-bottom: 10px; color: #525252;"><span style="box-sizing: inherit; color: #000000;">준비가 되었으면 아래 순서대로 비컨 설정해보세요.</span></p>
   <ol style="box-sizing: inherit; margin: 0px 0px 0px 20px; list-style-position: initial; list-style-image: initial; padding: 0px; color: #525252;">
      <li style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #000000;">BLE와 아두이노를 위 설명대로 연결.</span></li>
      <li style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #000000;">소스코드를 컴파일 및 업로드</span></li>
      <li style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #000000;">업로드 완료되면 시리얼 모니터 실행 (아두이노 IDE -&gt; 도구 -&gt; 시리얼 모니터)</span></li>
      <li style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #000000;">아래 붉은 글씨로 적힌&nbsp;<span style="box-sizing: inherit; color: #ff0000;"><strong style="box-sizing: inherit;">AT command</strong></span>&nbsp;를 순서대로 입력합니다. 커맨드가 제대로 설정된 경우&nbsp;<span style="box-sizing: inherit; color: #0000ff;"><strong style="box-sizing: inherit;">OK…</strong></span>&nbsp;와 같은 응답이 시리얼모니터에 표시됩니다.</span></li>
      <li style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #000000;">시리얼 모니터에&nbsp;<span style="box-sizing: inherit; color: #ff0000;"><strong style="box-sizing: inherit;">AT+RENEW</strong></span>&nbsp;입력 (공장초기화)</span></li>
      <li style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #ff0000;"><strong style="box-sizing: inherit;">AT+RESET</strong></span>&nbsp;(BLE 모듈을 리셋)</li>
      <li style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #ff0000;"><strong style="box-sizing: inherit;">AT</strong></span>&nbsp;(OK 응답이 오는지 확인)</li>
      <li style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #ff0000;"><strong style="box-sizing: inherit;">AT+MARJ0x1234</strong></span>&nbsp;(iBeacon의 Major 값을 0x1234 로 설정, 16진수, 원하는 값 넣으셔도 되고 이 과정 생략해도 됨)</li>
      <li style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #ff0000;"><strong style="box-sizing: inherit;">AT+MINO0xFA01</strong></span>&nbsp;(iBeacon의 Minor 값을 oxFA01로 설정, 16진수,원하는 값 넣으셔도 되고 이 과정 생략해도 됨)</li>
      <li style="box-sizing: inherit;"><span style="box-sizing: inherit; color: #ff0000;"><strong style="box-sizing: inherit;">A