Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit 7a5c5aa

Browse files
committed
Simple virtual_write example
1 parent 850bd8c commit 7a5c5aa

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

examples/virtual_write.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""
2+
Blynk is a platform with iOS and Android apps to control
3+
Arduino, Raspberry Pi and the likes over the Internet.
4+
You can easily build graphic interfaces for all your
5+
projects by simply dragging and dropping widgets.
6+
7+
Downloads, docs, tutorials: http://www.blynk.cc
8+
Sketch generator: http://examples.blynk.cc
9+
Blynk community: http://community.blynk.cc
10+
Social networks: http://www.fb.com/blynkapp
11+
http://twitter.com/blynk_app
12+
"""
13+
14+
import BlynkLib
15+
import time
16+
17+
BLYNK_AUTH = 'YourAuthToken'
18+
19+
# initialize Blynk
20+
blynk = BlynkLib.Blynk(BLYNK_AUTH)
21+
22+
tmr_start_time = time.time()
23+
while True:
24+
blynk.run()
25+
26+
t = time.time()
27+
if t - tmr_start_time > 1:
28+
print("1 sec elapsed, sending data to the server...")
29+
blynk.virtual_write(0, "time:" + str(t))
30+
tmr_start_time += 1

0 commit comments

Comments
 (0)