SunFounder 3in1 Kit
BlynkTimer timer;
void myTimerEvent()
{
Blynk.virtualWrite(V1, pinValue);
}
void setup()
{
timer.setInterval(1000L, myTimerEvent);
}
void loop()
{
timer.run(); // Initiates BlynkTimer
}
Blynk library provides a built-in timer, first we create a timer object.
BlynkTimer timer;
Set the timer interval in setup(), here we set to execute the myTimerEvent() function every 1000ms
timer.setInterval(1000L, myTimerEvent);
Run BlynkTimer in loop().
timer.run();
Edit the custom function myTimerEvent(), the code Blynk.virtualWrite(V1, pinValue) is used to write the
data pinValue for V1.
void myTimerEvent()
{
Blynk.virtualWrite(V1, pinValue);
}
6.4 4. Cloud Music Player
The goal of this project is to create a music player using Blynk. Music is played in the same way as in 5.7 Tone() or
noTone(), by writing the song in the program and playing it with a passive buzzer. however, in this example, we can
click the switch to play/pause and slide the slider to change the playback progress.
Required Components
In this project, we need the following components.
It’s definitely convenient to buy a whole kit, here’s the link:
Name ITEMS IN THIS KIT LINK
3 in 1 Starter Kit 380+
6.4. 4. Cloud Music Player 295