Sketch Warnings

So I'm trying to Verify this Sketch for my Project and this comes up.

C:\Users\Ali\Desktop\Arduino_101_Blynk_BLE\Arduino_101_Blynk_BLE.ino: In function 'void setup()':

C:\Users\Ali\Desktop\Arduino_101_Blynk_BLE\Arduino_101_Blynk_BLE.ino:39:34: warning: 'void BlynkCurieBLE::begin(const char*, BLEPeripheral&)' is deprecated (declared at C:\Users\Ali\Desktop\Arduino_101_Blynk_BLE\arduino-1.6.13\libraries\Blynk\src/BlynkSimpleCurieBLE.h:146) [-Wdeprecated-declarations]

   Blynk.begin(auth, blePeripheral);

                                  ^


Sketch uses 104,232 bytes (66%) of program storage space. Maximum is 155,648 bytes.

I would like to know if this will be a problem, if so how can I fix it?

Hi,

Please post your code and we can see what the errors are pointing to.

What Arduino are you using?

Thanks.. Tom.. :slight_smile:

Deprecated generally means "will disappear sometime in the future". However, I have seen such things never removed.

In any case, the solution is simple: reverse the parameters in the call to Blynk.begin.

#define BLYNK_PRINT Serial
#include <BlynkSimpleCurieBLE.h>
#include <CurieBLE.h>
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
  char auth[] = "c7459ff0a86745be9d71680223c5440a";

BLEPeripheral  blePeripheral;

// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); 

// Select which 'port' M1, M2, M3 or M4.
Adafruit_DCMotor *motor1 = AFMS.getMotor(1);
Adafruit_DCMotor *motor2 = AFMS.getMotor(2);

//######### SETUP ######################################
void setup() {
  Serial.begin(9600);
  delay(1000);

  // The name your bluetooth service will show up as, customize this if you have multiple devices
  blePeripheral.setLocalName("SwagMobile");
  blePeripheral.setDeviceName("SwagMobile");
  blePeripheral.setAppearance(384);

  Blynk.begin(auth, blePeripheral);

  blePeripheral.begin();
  Serial.println("Waiting for connections...");
    
  Serial.println("Adafruit Motorshield v2 - DC Motor");

  AFMS.begin();  // create with the default frequency 1.6KHz
  //AFMS.begin(1000);  // OR with a different frequency, say 1KHz
  
  // Set the speed to start, from 0 (off) to 255 (max speed)
  motor1->setSpeed(255);
  motor2->setSpeed(255);


}


//########## LOOP ######################################
void loop() {
  Blynk.run();
  blePeripheral.poll();
}


//######### Subrutines ################################

// This function will set the speed
BLYNK_WRITE(V0)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  // You can also use:
  // String i = param.asStr();
  // double d = param.asDouble();
  Serial.print("V0 Slider value is: ");
  Serial.println(pinValue);
  motor1->setSpeed(pinValue);
  motor2->setSpeed(pinValue); 
}

// Motor 1 Forward
BLYNK_WRITE(V1)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  Serial.print("Motor 1 Forward: ");
  Serial.println(pinValue);
  if(pinValue == 1) {
    motor1->run(FORWARD);
  }
  if(pinValue == 0) {
    motor1->run(RELEASE);  
  }
}


// Motor 2 Forward
BLYNK_WRITE(V2)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  Serial.print("Motor 2 Forward: ");
  Serial.println(pinValue);
  if(pinValue == 1) {
    motor2->run(FORWARD);  
  }
  if(pinValue == 0) {
    motor2->run(RELEASE);
  }
}

// Motor 1 Backward
BLYNK_WRITE(V3)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  Serial.print("Motor 1 Backward: ");
  Serial.println(pinValue);
  if(pinValue == 1) {
    motor1->run(BACKWARD);  
  }
  if(pinValue == 0) {
    motor1->run(RELEASE); 
  }
}

// Motor 2 Backward
BLYNK_WRITE(V4)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  Serial.print("Motor 2 Backward: ");
  Serial.println(pinValue);
  if(pinValue == 1) {
    motor2->run(BACKWARD);
  }
  if(pinValue == 0) {
    motor2->run(RELEASE);   
  }
}

I am using an Arduino 101

@CodingBadly
I have downloaded this Sketch of a website and am applying it on my Project. I have no experience in coding so if you could please show me how to reverse the parameters

ALIMONK:
I have no experience in coding…

At this point, your coding experience is irrelevant. A reasonable understanding of the English language, which you have demonstrated, is all that is necessary to complete the task.

so if you could please show me how to reverse the parameters

I will help you if you get stuck.

@CodingBadly
Thank you, It is no longer giving Errors.

You are welcome.