Void Setup()
This section of the code is executed once at startup. This is were you can initialize code or just run a task once when the device first powers on.
For this application we will define the pin mode of each I/O, set the default relay state, and connect to the Blynk cloud.
void setup()
{
for(int i=0; i<4; i++){
// for loop for setting each I/O pin mode as an output
pinMode(relayPins[i], OUTPUT);
digitalWrite(relayPins[i], LOW);
}
delay(5000);
Blynk.begin(auth); // connect to blynk cloud using auth token
}
Last updated