help!!!!

these are my coding...

#define BLYNK_PRINT Serial
#include <EEPROM.h>
#include "CurieIMU.h"
#include <BlynkSimpleCurieBLE.h>
#include <CurieBLE.h>
#include <Wire.h>
#include <SPI.h>
WidgetTerminal terminal(V2);
#define center A0 //Define FSR Sensor pins
#define left A1
#define right A2
#define buz 2

char auth[] = " 897e30dde9c14f518ff519e457696941"; //Enter your Blynk Authorization Code Here
BLEPeripheral blePeripheral;

int cal_weight;
int body_weight;
int fc, fr, fl;
int mr, ml, mc, cr, cl, cc;
int tempr, templ, tempc;
int cal_rec = 0;
int mem[10];
int val;
int x, y, z, thx, thy, thz;
int pin1;
int mode = 0;

void get_readings() {
for (int i = 0; i < 50; i++) {
fc = analogRead(center); //Get raw readings from sensors
fr = analogRead(right);
fl = analogRead(left);
thx = CurieIMU.readAccelerometer(X_AXIS);
thy = CurieIMU.readAccelerometer(Y_AXIS);
thz = CurieIMU.readAccelerometer(Z_AXIS);
delay(2);
}
fc = fc / 50;
fr = fr / 50;
fl = fl / 50;
thx = thx / 50; //Get the average values of the readings
thy = thy / 50;
thz = thz / 50;
}

void calibrate() {
while (mode == 1) {}

if (mode == 2) {
get_readings();

tempr = fr;
templ = fl; //Save the values of FSRs
tempc = fc;
}

while (mode == 3) {}

if (mode == 5) {
get_readings();

mr = (fr - tempr) / 100;
ml = (fl - templ) / 100;
mc = (fc - tempc) / 100; //Calculate threshold values
cr = 1000 - (mr * tempr);
cl = 1000 - (ml * templ);
cc = 1000 - (mc * tempc);
x = thx;
y = thy;
z = thz;

EEPROM.write(0, mr);
EEPROM.write(1, ml);
EEPROM.write(2, mc); //Write threshold values to EEProm
EEPROM.write(3, cr);
EEPROM.write(4, cl);
EEPROM.write(5, cc);
EEPROM.write(6, x);
EEPROM.write(7, y);
EEPROM.write(8, z);

}

}

void active() {

get_readings();

fc = fc * mc + cc; //Calculate forces on FSRs using pre-saved threshold values
fl = fl * ml + cl;
fr = fr * mr + cr;

if (abs(fl - fr) > 300) {
tone(buz, 300); //Alerts if straps are unbalanced
terminal.println("Straps are unbalanced");
}
if (fc > 500) {
tone(buz, 600); //Alerts if the backpack is overfilled
terminal.println("Harmful force on the spine.");
}
if (fl + fr > cal_weight) {
tone(buz, 1400); //Alerts if the backpack is over-weight
terminal.println("Too heavy");
}

if (abs(thx - x) > 30 or abs(thy - y) > 30 or abs(thz - z) > 30) { // Alerts about improper angles
tone(buz, 2000);
terminal.println("Harmful posture detected");
}
delay(500);
digitalWrite(buz, LOW);
}

void setup() {
pinMode(3, OUTPUT);
pinMode(left, INPUT);
pinMode(right, INPUT); //Setting the sensor pin modes
pinMode(center, INPUT);
mr = EEPROM.read(0);
ml = EEPROM.read(1);
mc = EEPROM.read(2); // Read the saved values from EEProm
cr = EEPROM.read(3);
cl = EEPROM.read(4);
cc = EEPROM.read(5);
thx = EEPROM.read(6);
thy = EEPROM.read(7);
thz = EEPROM.read(8);
Serial.begin(9600);

blePeripheral.setLocalName("Arduino101Blynk");
blePeripheral.setDeviceName("Arduino101Blynk");
blePeripheral.setAppearance(384);

Blynk.begin(auth, blePeripheral);

blePeripheral.begin();
}

void loop() {
Blynk.run();
blePeripheral.poll();

BLYNK_WRITE(V0)

{
body_weight = param.asInt();
}
cal_weight = body_weight / 10; // Calculate the safe carrying weight

BLYNK_WRITE(V1)
{
pin1 = param.asInt();
if (pin1 == 1) {
mode = mode + 1;
calibrate();
}

}
BLYNK_WRITE(V2) {
if (mode == 2) {
terminal.print("Put 1kg weight and Press Enter");
mode = mode + 1;
} // Terminal Notifications in the calibration process
if (mode == 3) {
terminal.println("Values Saved");
terminal.println("Put 2kg weight and Press Enter");
mode = mode + 1;
}
if (mode == 6) {
terminal.println("Values Saved");
terminal.println("Calibration Succesfull");
mode = 0;
active();
}
}

BLYNK_WRITE(V3) { // Enter button
int pin3 = param.asInt();
if (pin3 == 1) {
mode = mode + 1;
}
}

BLYNK_WRITE(V4) { // Turn On/Off the buzzer
int pin4 = param.asInt();
if (pin4 == 1) {
tone(buz , 1000);
}
if (pin4 == 0) {
digitalWrite(buz , LOW);
}
}
BLYNK_WRITE(V5) { //Turning on the device
int pinValue = param.asInt();

if (pinValue == 1) {
while (pinValue == 1) {
int pinValue = param.asInt();

active();

}
}
}

...

and these are the errors...someone hlp me pls

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino 101"

C:\Users\neo19\Documents\Arduino\sketch_jan05b\sketch_jan05b.ino: In function 'void setup()':

C:\Users\neo19\Documents\Arduino\sketch_jan05b\sketch_jan05b.ino:140:34: warning: 'void BlynkCurieBLE::begin(const char*, BLEPeripheral&)' is deprecated (declared at C:\Users\neo19\Documents\Arduino\libraries\Blynk\src/BlynkSimpleCurieBLE.h:146) [-Wdeprecated-declarations]

Blynk.begin(auth, blePeripheral);

^

C:\Users\neo19\Documents\Arduino\sketch_jan05b\sketch_jan05b.ino: In function 'void loop()':

sketch_jan05b:153: error: a function-definition is not allowed here before '{' token

{

^

sketch_jan05b:159: error: a function-definition is not allowed here before '{' token

{

^

sketch_jan05b:212: error: expected '}' at end of input

}

^

exit status 1
a function-definition is not allowed here before '{' token

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Welcome to the Forum. Please read these two posts:

How to use this forum - please read.
and
Read this before posting a programming question ...
You may also find useful information that would answer your question here:
Useful links - check here for reference posts / tutorials

You have posted code without using code tags. The code tags make the code look

like this

when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don't do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons. The "Code: [Select]" feature allows someone to select the entire sketch so it can be easily copied and pasted into the IDE for testing.
If you have already posted without using code tags, open your message and select "modify" from the pull down menu labelled, "More", at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the "</>" icon at the upper left hand corner. Click on the "Save" button. Code tags can also be inserted manually in the forum text using the code and /code metatags.

Unless the sketch is too large, it's better if you post your code, rather than attach it. When it's attached, we have to download it, create a folder then open your code in our IDE. And afterwards, the folder remains unless we navigate to the "Temp" folder and manually remove it. It's much easier to just view the code in your post.

Many questions can be answered by reading the documentation which is provided with the IDE, available under the help tab, or online here.

There are many other things that programmers do to make their code understandable. Please do them, as a courtesy to the members who volunteer their time to help you here. One is to provide the entire code, not just a snippet. Use a standard indentation to clearly show the code blocks. Never put more than one statement per line. Place any brackets by themselves on a separate line. Use blank lines sparingly, no more than one at a time. Before posting the code, use Ctrl-T in the IDE to reformat the code in a standard format, which makes it easier for us to read. Another is to give things descriptive names. Use descriptive variable names, for example "temperature" instead of "t". You can name numerical constants, pin numbers, variables and many other things in this way. For example, you can refer to a pin and an output level by number, like digitalWrite(3,0). But such a statement doesn't reveal anything about the purpose. digitalWrite(hornRelayPin, LOW) does. You can do that by declaring const byte hornRelayPin = 3; before setup() in your program. Many such names are already defined for you by the compiler and the Arduino IDE. Here are some:

#define HIGH 0x1
#define LOW  0x0
#define PI 3.1415926535897932384626433832795

Use them. There are many more. Use compiler math to compute values so you can see where they came from (or at least document them). For example, if you see the number 73, you would be hard put to explain the significance of it. But if you see "daysPerYear/5", it is obvious. One more thing. When you work on program continuously, you become familiar with it. So many things seem obvious even if they are not spelled out explicitly. But try looking at your own code six months later. It will be as if a stranger wrote it. So write for strangers, not yourself.

"Depricated" means "We made a better way to do this so you shouldn't use this old function anymore. This function may be removed in future versions of the library. You have been warned."

Many of your error are caused by mismatched brackets .Common compiler errors caused by mismatched brackets:

"does not name a type" or
"expected declaration before"
Usually means you forgot a '{' or put in an extra '}' in the previous function. Since all of the open brackets have been closed, the compiler is looking for further global declarations (variables or functions). If it finds something that looks like executable code instead of a global declaration it emits an error. Make sure that the brackets in the preceding function are in matching pairs '{' followed by '}'.

"a function-definition is not allowed here"
Usually means you forgot a '}' or put in an extra '{' in the previous function. Since a set of brackets has not been closed yet the compiler is looking for more code to put in the function. You can't declare a function inside a function so if the compiler finds a function definition it emits an error. Make sure that the brackets in the preceding function are in matching pairs '{' followed by '}'.

"expected '}' at end of input"
Usually means you forgot a '}' or put in an extra '{' in the last function in the sketch. Since a set of brackets has not been closed yet, the compiler is looking for more code to put in the function. When it hits the end of the file instead it emits an error. Make sure that the brackets in the last function are in matching pairs '{' followed by '}'.

"expected primary-expression before '}' token"
Usually means you have an incomplete statement before a '}'. The block statement (between '{' and matching '}') can only contain complete statements.

Given that you are brand new to coding perhaps you might consider giving Ardublocks a try.

It is a plugin tool for Arduino IDE that lets you write sketches by plugging together puzzle pieces.

It will give you an understanding of C language without the stress of simultaneously dealing with syntax errors.

Once you feel confident with that perhaps migrate to direct c coding and learn the language syntax.

A benefit of Ardublocks is that it generates C code from your blocks which then appears in the main Arduino IDE editor.

So it will also help you to gain an understanding of c language syntax over time.