A function-definition is not allowed here before '{' token?

Ok sorry :smile:
In my answer i asked you if you Could Send me a sketch or an Full example Code for my project i described over your Post.

It would really help me cause im really bad in Coding :sweat_smile:

You need to use interrupt on checkPin otherwise you might miss some situations when button was pressed.

For Simple Timer you can find tutorial here: http://playground.arduino.cc/Code/SimpleTimer

It’s always better to read those to understand whats going on you will learn coding this way rather than just copying pieces of code.

Ok but how do i Code that After the first push the Roller shutter goes down; at the 2nd within predefined seconds it stops and After the third push or After the 2nd After the predefined time the Roller shutter goes up

In combination with a physical button and the blynk app on my smartphone that looks really complicated to me :sweat:

You need to detect roller position there are two options but easiest one would be to use hc-sr04 not a pretty solution but will work. And basically read the distance. Or you can use some fancy laser sensors or whatever lol.
Also there is one stupid way which is simply detecting if roller is closed that would be done by using some switch at the end thats pushed by roller when it closes.

But the Roller stops automatically didnt i need only a working sketch for that?

OK but how do you know current roller position? If you can affect the position of the roller either by using app or manually. Assuming you want just one button in the app to open and close you need to detect current roller state.

Doesnt im able to detect the position by the number of button pushes

I’m not gonna code for you the whole thing but I’ll give you flow how you should do it and what.

  1. You need callback on two buttons that can be pushed manually and store this state inside variable, this should be attached as interrupt in order to work properly otherwise it wont work.

  2. You need simple function that decides based on current state which relay to open. It opens relay then you setup SimpleTimer callback to close relay in lets say 1 second you can do this by using setTimeout() function.

  3. You can display Roller status using LED or LCD whatever I don’t know.

People won’t write whole code for you seriously even though your stuff is easy it still takes a bit of time. I sucked before in coding spent a lot on learning how to do it and I’ve read thousands of pages now I know a lot and even get job offers despite the fact my education is in Mechanical Eng. So design related stuff but i still code better than most of the people after IT studies…