<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hello, I am using BLE shield from Redbear Lab v2.1, with nRF 8001 BLE chip on it, with Arduino UNO- how to find connection interval</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10639/hello-i-am-using-ble-shield-from-redbear-lab-v2-1-with-nrf-8001-ble-chip-on-it-with-arduino-uno--how-to-find-connection-interval</link><description>I want to get sensor data from arduino, with atleast 200 samples per second, but at present I am only getting around 20 samples per second. I went through forums and got to know that nRF8001 can send only 1 data packet per connection event, and the RBL_nRF8001</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Dec 2015 10:17:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10639/hello-i-am-using-ble-shield-from-redbear-lab-v2-1-with-nrf-8001-ble-chip-on-it-with-arduino-uno--how-to-find-connection-interval" /><item><title>RE: Hello, I am using BLE shield from Redbear Lab v2.1, with nRF 8001 BLE chip on it, with Arduino UNO- how to find connection interval</title><link>https://devzone.nordicsemi.com/thread/39691?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2015 10:17:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a75eca04-83fd-429e-b227-256ac6ddbc17</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;It seems that the library has a 64 byte TX buffer. This does not mean that it can send 64 bytes in one packet over BLE. The limit for BLE is 20 bytes/packet (at the moment).&lt;/p&gt;
&lt;p&gt;I found the library you are using &lt;a href="http://redbearlab.com/getting-started-bleshield"&gt;here&lt;/a&gt;. I recommend you to include relevant links in future posts to make is easier for others to help you.&lt;/p&gt;
&lt;p&gt;In RBL_services.h, we find the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define GAP_PPCP_MAX_CONN_INT 0x12 /**&amp;lt; Maximum connection interval as a multiple of 1.25 msec , 0xFFFF means no specific value requested */
#define GAP_PPCP_MIN_CONN_INT  0x6 /**&amp;lt; Minimum connection interval as a multiple of 1.25 msec , 0xFFFF means no specific maximum*/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This means that we have worst case connection interval of 22.5 ms, a best case of 7.5 ms. This gives a theoretical throughput between ~21.3 kbps and ~7 kbps. You need 200*10bit = 2 kbps for you application, so this should work.&lt;/p&gt;
&lt;p&gt;Can you try to measure how often you use &lt;code&gt;ble_write&lt;/code&gt; and &lt;code&gt;ble_do_events&lt;/code&gt;, the arduino function &lt;code&gt;micros()&lt;/code&gt; should help you with that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hello, I am using BLE shield from Redbear Lab v2.1, with nRF 8001 BLE chip on it, with Arduino UNO- how to find connection interval</title><link>https://devzone.nordicsemi.com/thread/39689?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2015 15:50:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2614ccff-d44f-4e94-8201-7645231f6031</guid><dc:creator>csj</dc:creator><description>&lt;p&gt;Yeah. I am using Simple chat, from the BLE controller app of Red bear lab, to send character and see data, if I press &amp;#39;a&amp;#39;, the Arduino starts sending data, if I send b it stops.
In the code I have used sprintf and pointers because I am separating the data as individual digits, and sending each digit as 1 byte&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;lt;SPI.h&amp;gt;
#include &amp;lt;EEPROM.h&amp;gt;
#include &amp;lt;boards.h&amp;gt;
#include &amp;lt;RBL_nRF8001.h&amp;gt;

int analogPin = 3;
int z;
void setup()
{  
    ble_begin();
    Serial.begin(57600);
}
void loop()
{
  if ( ble_available() )
  {     z=ble_read();
        if(z==97)
        {
          bailout:
          while( ble_available()==0 )
          {
            int val= analogRead(analogPin);
            int b[1]={val};
            char msg[100]={0};
            char *p=msg;
            int j;
            if(val&amp;lt;1000) j=3;
            else if(val&amp;lt;100) j=2;
            else if(val&amp;lt;10) j=1;
            else j=4;
           for(int i=0;i&amp;lt;j;i++)
                {
                   sprintf(p +=strlen(p),&amp;quot;%d&amp;quot;,b[i]);
                   ble_write(msg[i]);
                }
        ble_do_events();
        }
        z=ble_read();
        if( z==98 )
        {
          ble_do_events();
        }
        else goto bailout;   
    }
    else Serial.print(&amp;quot;Failed\n&amp;quot;);
    ble_do_events();
 }
ble_do_events();
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hello, I am using BLE shield from Redbear Lab v2.1, with nRF 8001 BLE chip on it, with Arduino UNO- how to find connection interval</title><link>https://devzone.nordicsemi.com/thread/39690?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2015 13:48:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60549721-4481-41ae-8c96-c9ed3d9d8c7d</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Hey.&lt;br /&gt;
Can you post you code, and also links to the Arduino library you are using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>