Skip to content

Commit cc98552

Browse files
committed
Add WinnerMicro W600 support
1 parent b7e56ab commit cc98552

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ while True:
6868
- `notify`, `tweet`
6969
- `log_event`
7070
- events: `Vn`, `readVn`, `connected`, `disconnected`
71-
- can run on embedded hardware, like `ESP8266`, `ESP32`, or `OpenWrt`
71+
- can run on embedded hardware, like `ESP8266`, `ESP32`, `W600` or `OpenWrt`
7272

7373
## Ubuntu/Linux/Raspberry Pi installation
7474

examples/hardware/WM_W600.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
This example shows how to initialize your W600 board
14+
and connect it to Blynk.
15+
16+
Don't forget to change WIFI_SSID, WIFI_PASS and BLYNK_AUTH ;)
17+
"""
18+
19+
import BlynkLib
20+
import machine
21+
from easyw600 import *
22+
23+
WIFI_SSID = 'YourWiFiNetwork'
24+
WIFI_PASS = 'YourWiFiPassword'
25+
26+
BLYNK_AUTH = 'YourAuthToken'
27+
28+
29+
wifi = connect(WIFI_SSID, WIFI_PASS)
30+
31+
print("Connecting to Blynk...")
32+
blynk = BlynkLib.Blynk(BLYNK_AUTH, log=print)
33+
34+
@blynk.on("connected")
35+
def blynk_connected(ping):
36+
print('Blynk ready. Ping:', ping, 'ms')
37+
38+
@blynk.VIRTUAL_WRITE(1)
39+
def v1(param):
40+
print('!!!VIRTUAL_WRITE', param)
41+
42+
@blynk.ON("V2")
43+
def v2(param):
44+
print('!!!ON')
45+
46+
@blynk.on("V3")
47+
def v3(param):
48+
print('!!!on')
49+
50+
def runLoop():
51+
while True:
52+
blynk.run()
53+
machine.idle()
54+
55+
runLoop()

0 commit comments

Comments
 (0)