[Solved] Compile error, instance not declared

Hello,
Please help. I’m very new.
I used examples from the topic. It’s a small test program (a part) for a bigger project;

When compile, I receive the message ‘param’ was not declared in this scope. (in line: int i=param.asInt())
Where I’m wrong?

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

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


void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, "...........................", "................");
  pinMode(pin, OUTPUT);
  
 }
void scriepin()
{
        BLYNK_WRITE(3); //iin Blynk App a push button was created for virtual pin 3:
            {
            int i=param.asInt()
            if i==1 {
                //HIGH
                digitalWrite(pin,HIGH);
                } else {
               //LOW
               digitalWrite(pin,LOW);
                } 
            } 
}

void loop()
{
  Blynk.run();
  scriepin(); // a LED was installed on PIN4 through a 1K resistor
}

@ctlndobrescu please edit your post, select the sketch and then format it by pressing the </> icon.

You do not need the scriepin function as the Android / iPhone App sends the signal to the Blynk server and this in turn looks for BLYNK_WRITE(3); in your sketch.

Do you really need a 1K resistor as I would have thought 150 Ohms would be adequate?

Hello
@Costas thanks for replay.
Starting with the resistor, usually I’m using a value around 470 ohms (arround 10mA). Right now I used 1K because I didn’t had a smaller value at that moment; but it’s only for tests and it’ enough…
Back to app.; first at all the button was switch not push, sorry. It’s only a test w/o any importance; could be a Blink LED as well. Of course I’m aware that the button could command the LED installed on the Arduino pin directly and not through virtual pin. I tried to send into Arduino the state of app. button because I need to test the way virtual pins are working; I need to learn.
I don’t understand why I received compile error message! What it’s wrong?
Thanks

Are you using IDE 1.6.7 as functions need to be in a specific order now?

I think your problem though is that you are trying to call a Blynk function within your scriepin function.
Fixed your sketch, this compiles ok.

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

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


void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, "...........................", "................");
  pinMode(pin, OUTPUT);
  
 }
//void scriepin()
//{
        BLYNK_WRITE(3) //; //in Blynk App a push button was created for virtual pin 3:
            {
            int i=param.asInt();
            if (i==1) {
                //HIGH
                digitalWrite(pin,HIGH);
                } else {
               //LOW
               digitalWrite(pin,LOW);
                } 
            } 
//}

void loop()
{
  Blynk.run();
  //scriepin(); // a LED was installed on PIN4 through a 1K resistor
}

OK thanks
yes I’m using 1.6.7.

@Costas
Thanks again