BLE Communication

I have an arduino 101 board connected to com port 4 and a BLE connected to com port 6 written as arduino uno. Why is the BLE written as arduino uno? And i need help to upload that sketch from my arduino 101 to the android app that im using via BLE. So whats the first few lines of code should i implement at the top of my sketch? Need some guidance here as im a newbie. Tyvm.

Mdzain:
Why is the BLE written as arduino uno?

I guess we can all wonder what "written as" means, but I guess the answer is that it isn't.

Nick_Pyner:
I guess we can all wonder what "written as" means, but I guess the answer is that it isn't.

Yeah just found out it isn't. Do u know how can display the graph i have gotten from my arduino to an android app? I have found an app that does the same job as the serial plotter on the ide but i am not sure what is the code i should implement to make sure my arduino board is bluetooth ready.

Here is the code that works on the ide serial plotter

#include "CurieIMU.h"

int ledPin = 13;  // use the built in LED on pin 13 of the Uno

// IMU
float FS_SEL = 131;                                  // IMU gyro values to degrees/sec
unsigned long last_read_time;
float angle_x, angle_y, angle_z;                     // These are the result angles
float last_x_angle, last_y_angle, last_z_angle;      // These are the filtered angles
float lGXA, lGYA, lGZA;                              // Store the gyro angles to compare drift

// FUNCTIONS
//Math
//Convert radians to degrees
double rtod(double fradians) {return(fradians * 180.0 / PI);}

void set_last_read_angle_data(unsigned long time, float x, float y, float z, float x_gyro, float y_gyro, float z_gyro) {
  last_read_time = time;
  last_x_angle = x; last_y_angle = y; last_z_angle = z;
  lGXA = x_gyro; lGYA = y_gyro; lGZA = z_gyro;
}

void setup() {

   pinMode(ledPin, OUTPUT);
    digitalWrite(ledPin, LOW);

  Serial.begin(9600); // Default connection rate for my BT module
  while (!Serial);

  // init CurieImu 
  CurieIMU.begin
  ();
  // use the code below to calibrate accel/gyro offset values
  Serial.println("Internal sensor offsets BEFORE calibration...");
  Serial.print(CurieIMU.getXAccelOffset()); 
  Serial.print("\t"); // -76
  Serial.print(CurieIMU.getYAccelOffset()); 
  Serial.print("\t"); // -235
  Serial.print(CurieIMU.getZAccelOffset()); 
  Serial.print("\t"); // 168
  Serial.print(CurieIMU.getXGyroOffset()); 
  Serial.print("\t"); // 0
  Serial.print(CurieIMU.getYGyroOffset()); 
  Serial.print("\t"); // 0
  Serial.println(CurieIMU.getZGyroOffset());

  // The board must be resting in a horizontal position for 
  // the following calibration procedure to work correctly!
  CurieIMU.autoCalibrateGyroOffset();
  CurieIMU.autoCalibrateXAccelOffset(0);
  CurieIMU.autoCalibrateYAccelOffset(0);
  CurieIMU.autoCalibrateZAccelOffset(1);
  CurieIMU.setGyroOffsetEnabled(true);
  CurieIMU.setAccelOffsetEnabled(true);

  set_last_read_angle_data(millis(), 0, 0, 0, 0, 0, 0);
}
 
void loop() {
  unsigned long t_now = millis();
  int ax = CurieIMU.getAccelerationX();
  int ay = CurieIMU.getAccelerationY();
  int az = CurieIMU.getAccelerationZ();
  int gx = CurieIMU.getRotationX();
  int gy = CurieIMU.getRotationY();
  int gz = CurieIMU.getRotationZ();


  // Convert gyro values to degrees/sec
  float gyro_x = gx/FS_SEL;
  float gyro_y = gy/FS_SEL;
  float gyro_z = gz/FS_SEL;

   // Compute the accel angles
  float accelX = rtod(atan(ay / sqrt( pow(ax, 2) + pow(az, 2))));
  float accelY = rtod(-1 * atan(ax/sqrt(pow(ay,2) + pow(az,2))));
  
  // Compute the (filtered) gyro angles
  float dt =(t_now - last_read_time)/1000.0;
  float gyroX = gyro_x*dt + last_x_angle;
  float gyroY = gyro_y*dt + last_y_angle;
  float gyroZ = gyro_z*dt + last_z_angle;  

  // Compute the drifting gyro angles
  float unfiltered_gyro_angle_x = gyro_x*dt + lGXA;
  float unfiltered_gyro_angle_y = gyro_y*dt + lGYA;
  float unfiltered_gyro_angle_z = gyro_z*dt + lGZA;
  
  // Apply the complementary filter to figure out the change in angle 
  // Alpha depends on the sampling rate...
  float alpha = 0.96;
  angle_x = alpha*gyroX + (1.0 - alpha)*accelX;
  angle_y = alpha*gyroY + (1.0 - alpha)*accelY;
  angle_z = gyroZ;  //Accelerometer doesn't give z-angle

  // Update the saved data with the latest values
  set_last_read_angle_data(t_now, angle_x, angle_y, angle_z, unfiltered_gyro_angle_x, unfiltered_gyro_angle_y, unfiltered_gyro_angle_z);

  Serial.print(',');
  Serial.print(angle_x);
  Serial.print(',');
  Serial.print(angle_y);
  Serial.print(','); 
  Serial.println(angle_z); 
  Serial.println();
}

I use Bluetooth Graphic Terminal which is the Android app that was clearly written by God, and indeed proof she uses an Arduino. Adequate instructions are included. The floats are assembled into a single string and Serial.printed each time round the loop.

You might also have look at BlueGraph, which was done by a guy on this forum.