Não consigo obter um valor do Blynk

Estou com um esp8266 e quero obter um valor do “Numeric Input Settings” do Blynk mas não estou a conseguir.

int valueIn = param.asInt();

Coloquei o código acima mas dá sempre este erro:

C:…: In function ‘void loop()’:

Project:158:8: error: a function-definition is not allowed here before ‘{’ token



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

I think we need to see your full sketch.


Mas é precisa alguma biblioteca para aquele código? Para o Blynk_Write? ou o param.asInt()

Yes, but that’s not what your error message is about.
I suspect that you have this BLYNK_WRITE callback function in your void loop, but without seeing your full sketch it’s impossible to say.


[Unformatted code removed by moderator]

@Leandro_Silva please edit your post and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:


@Leandro_Silva the characters you’ve added aren’t triple backticks. Copy and paste the ones I provided for you if you can’t work out which key on the keyboard to use.


@Leandro_Silva I’ve deleted your library question from the other unrelated topic.
Libraries are not your issue, incorrect code structure is the problem.

However, I make a point never to comment on code until the person posting the code follows the basic code formatting rules as explained in the Welcome topic and in text that appears when you create a new topic.
Sort-out the triple backticks and I will explain your coding issues, otherwise your unformatted code will be deleted.


Já consegui resolver muito obrigado! Estava a colocar o código dentro do void loop()
Foi um erro básico de principiante, desculpe o incómodo.