Raspberry 3 Blynk Library C++ problem

Hello.
I have Raspberry 3 ad Blynk library for C.

All run correctly, I can read vitualPin, widget etc but when I used digitalWrite function, I get an error.
Please find below my main.cpp and the errors

Porque no hay nada en Español de este tema (blynk library). Somos mas de 300 millones y no hay ni una sola web. hay que hacer algo.

Main.cpp

#define BLYNK_PRINT stdout
#ifdef RASPBERRY
  #include <BlynkApiWiringPi.h>
#else
  #include <BlynkApiLinux.h>
#endif
#include <BlynkSocket.h>
#include <BlynkOptionsParser.h>

static BlynkTransportSocket _blynkTransport;
BlynkSocket Blynk(_blynkTransport);

#include <BlynkWidgets.h>

BLYNK_WRITE(V1)
{
  printf("Got a value: %s\n", param[0].asStr());
  Blynk.virtualWrite(V0,1);
  digitalWrite(17,1);
  
}
void setup()
{

}

void loop()
{
  Blynk.run();
}


int main(int argc, char* argv[])
{
    const char *auth, *serv;
    uint16_t port;
    parse_options(argc, argv, auth, serv, port);

    Blynk.begin(auth, serv, port);

    setup();
    while(true) {
        loop();
    }

    return 0;
}

The compilation error executed with clean all target=raspberry I am using the last library version 0.8…4

main.cpp:29:20: error: ‘digitalWrite’ was not declared in this scope
   digitalWrite(17,1);
                    ^

.
Many thanks for your help

Correct me if I’m wrong, but are you trying to run an Arduino sketch on the Pi? Because that will not work.

This code looks like you got a couple things mixed up :slight_smile:

@aguacristalina see if this thread helps Using C++ on a Raspberry Pi with Blynk

Many thanks for the answer. I followed the Costas post but my system does not recognize digitalWrite. I supose that this functions is only valid for Arduino but it is not valid for Raspberry. Anybody could answer about it. It is only for Arduino ???

There are not documentation for Raspberry , only for Arduino… (the example when you install Blynk in RPI are fro Arduino… the mayority of the Rasbberry sketch are valid only for Arduino. I copied several of them generate in this web (blynk web) and it is does not run in Raspberry.

Did you install WiringPi?

According to most Raspi examples, e.g. https://examples.blynk.cc/?board=Raspberry%20Pi&shield=System%20default&example=More%2FSync%2FSyncPhysicalButton this one, it should work.