hi am trying to make led panel with 2 mode. like manual and automatic with pir

hi am trying to make led panel with 2 mode. like manual and automatic with pir.
For example light is controlled by bluetooth app in the there will be three button - select bluetooth, turn on light and turn off light, then auto mode and manual toggle botton
when i set in manual the light should work with on and off
if its in auto mode the light should be there in 50% and when we get pulse from pir the light should be 100% for 1 minute and if there is no pulse is getting from pir it should go to 50%
this the function am trying to build
the below code was got from internet and i tried to alter it
so pls help me to build this one

#include <SoftwareSerial.h>
SoftwareSerial mySerial(6, 7); // RX, TX

int counter = 0;

int buttonPin = 13;

char bt_data;

int s = 10; //PIR outPin on digital 10
int led1 = 11; //led1 on 4

int led = 3;

void setup()
{
pinMode(s,INPUT); //Setting Sensor as Input
pinMode(led1,OUTPUT);
pinMode(led,OUTPUT);

Serial.begin(9600);

}

void loop()
{
if(mySerial.available()>0){bt_data = mySerial.read();
{
digitalRead(buttonPin);
if(buttonPin = HIGH){
counter+1;
}
else{}
}
{
if(counter == 1)
{
digitalWrite(led1,HIGH);//By default lights off
analogWrite(led1,255/5);
delay(60000); //1 minute delay so that the PIR gets enough hot to function

goto off; //going to off

ON: //the ON statement
{
digitalWrite(led1,HIGH);

if((digitalRead(s))) //if Again sensor input has been read - switch off
{
digitalWrite(led1,HIGH); //switch off
analogWrite(led1,255/5);

delay(6500); //around 7 seconds delay
/* PIR needs at least 5 seconds to function again*/
goto off;
}

else //Else just Be ON
{
goto ON;
}
}

off: //OFF statement
{

digitalWrite(led1,HIGH);
analogWrite(led1,255/5);

if((digitalRead(s))) //if again sensor input has been read - switch ON
{
digitalWrite(led1,HIGH); //switch on
delay(6500); /* PIR needs at least 5 seconds to function again*/
goto ON;
}

else //just be off
{
goto off;
}
}
}

else if(counter == 2)
{
if(Serial.available()>0)
{
char data = Serial.read();
if (data == 'a')
{
digitalWrite(led,HIGH);
}
else if(data == 'b')
{
digitalWrite(led,LOW);
}
}
}
}
}
}

Please start by reading Read this before posting a programming question and following the instructions to post your code properly using code tags after Auto formatting it in the IDE

Doing so will make it easier to read and understand which means that you are more likely to get helpful replies and may even help you to spot problems with the code structure and logic

I would start by eliminating the goto commands which lead to hard to follow logic

i done the auto formatting, if i want to delete the previous code post and post a new one again
because am new to this

Post your formatted code in a new reply so that comments to the original make sense. Don't forget to use code tags when you post it

#include <SoftwareSerial.h>
SoftwareSerial mySerial(6, 7); // RX, TX

int counter = 0;

int buttonPin = 13;

char bt_data;

int s = 10;     //PIR outPin on digital 10
int led1 = 11;   //led1 on 4

int led = 3;

void setup()
{
  pinMode(s, INPUT);       //Setting Sensor as Input
  pinMode(led1, OUTPUT);
  pinMode(led, OUTPUT);

  Serial.begin(9600);




}

void loop()
{
  if (mySerial.available() > 0) {
    bt_data = mySerial.read();
    {
      digitalRead(buttonPin);
      if (buttonPin = HIGH) {
        counter + 1;
      }
      else {}
    }
    {
      if (counter == 1)
      {
        digitalWrite(led1, HIGH); //By default lights off
        analogWrite(led1, 255 / 5);
        delay(60000);               //1 minute delay so that the PIR gets enough hot to function

        goto off;           //going to off

ON:                  //the ON statement
        {
          digitalWrite(led1, HIGH);


          if ((digitalRead(s)))  //if Again sensor input has been read - switch off
          {
            digitalWrite(led1, HIGH);   //switch off
            analogWrite(led1, 255 / 5);

            delay(6500);        //around 7 seconds delay
            /* PIR needs at least 5 seconds to function again*/
            goto off;
          }

          else           //Else just Be ON
          {
            goto ON;
          }
        }

off:              //OFF statement
        {

          digitalWrite(led1, HIGH);
          analogWrite(led1, 255 / 5);

          if ((digitalRead(s)))      //if again sensor input has been read - switch ON
          {
            digitalWrite(led1, HIGH);   //switch on
            delay(6500);           /* PIR needs at least 5 seconds to function again*/
            goto ON;
          }

          else        //just be off
          {
            goto off;
          }
        }
      }

      else if (counter == 2)
      {
        if (Serial.available() > 0)
        {
          char data = Serial.read();
          if (data == 'a')
          {
            digitalWrite(led, HIGH);
          }
          else if (data == 'b')
          {
            digitalWrite(led, LOW);
          }
        }
      }
    }
  }
}

So where are you stuck ?
What does the sketch do when you run it compared to what you want it to do ?

This code is by no means integrated with an android program running over bluetooth. Plus there seems to be a LOT of things wrong with it.
As suggested somewhere here on the forum, its highly discouraged to modify someone elses code to do something. You can very quickly lose sight if you dont have a crystal clear objective.this brings a few more questions to the table...

what hardware are you using? bluetooth and arduino.

Why are you using software serial?

what was the aforementioned code intended for?

hi am trying to make led panel with 2 mode. like manual and automatic with pir.
For example light is controlled by bluetooth app in the there will be three button - select bluetooth, turn on light and turn off light, then auto mode and manual toggle botton
when i set in manual the light should work with on and off
if its in auto mode the light should be there in 50% and when we get pulse from pir the light should be 100% for 1 minute and if there is no pulse is getting from pir it should go to 50%
this the function am trying to build

The code has nested goto statements. That makes it really difficult to unravel. I suggest looking at better code for PIR, serial, and so on, play with it until you understand it, and then put some of those ideas together into a sketch.

yuvatcp:
hi am trying to make led panel with 2 mode. like manual and automatic with pir.
For example light is controlled by bluetooth app in the there will be three button - select bluetooth, turn on light and turn off light, then auto mode and manual toggle botton
when i set in manual the light should work with on and off
if its in auto mode the light should be there in 50% and when we get pulse from pir the light should be 100% for 1 minute and if there is no pulse is getting from pir it should go to 50%
this the function am trying to build

You just copy pasted your post.. Like, how hard is it to read and understand what we here are asking?

i remember someone here said, " If this was an architect forum, people would post," Hey i need to build a bridge, send drawings""