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

Commit c59a069

Browse files
authored
Add digital write direct mapping function for ESP8266/ESP32
Add digital write direct mapping function for ESP8266/ESP32 so that you can set widgets in Blynk to send 0/1 to phisical pins without using virtual pins.
1 parent c969bc4 commit c59a069

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

BlynkLib.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ def process(self, data=None):
201201
elif args[0] == 'vr':
202202
self.emit("readV"+args[1])
203203
self.emit("readV*", args[1])
204+
elif args[0] == 'dw':
205+
if os.uname()[0][0:3] == 'esp': # ESP8266/32
206+
p = machine.Pin(int(args[1]), machine.Pin.OUT)
207+
p.value(int(args[2]))
204208
elif cmd == MSG_INTERNAL:
205209
self.emit("int_"+args[1], args[2:])
206210
else:

0 commit comments

Comments
 (0)