Skip to content

Commit

Permalink
lib/blynk: Heart beat LED is now controlled via the wipy module.
Browse files Browse the repository at this point in the history
  • Loading branch information
danicampora committed Oct 21, 2015
1 parent 1b79563 commit 155c088
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/blynk/BlynkLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ def my_user_task():
except ImportError:
import MachineStub as machine
const = lambda x: x
try:
import wipy
except ImportError:
import WiPyStub as wipy

HDR_LEN = const(5)
HDR_FMT = "!BHH"
Expand Down Expand Up @@ -138,7 +142,7 @@ def __init__(self, pin_num, mode, pull):
pin_num = int(pin_num)
self._name = 'GP' + str(pin_num)
if pin_num == HwPin._HBPin:
machine.HeartBeat().disable()
wipy.heartbeat(False)

def _config(self, duty_cycle=0):
if self._function == 'dig':
Expand Down
11 changes: 11 additions & 0 deletions lib/blynk/WiPyStub.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python3

"""
Stub of the wipy module, useful to run the Blynk client using CPython.
"""

def heartbeat(enable):
if (enable):
print('Heart beat LED enabled')
else:
print('Heart beat LED disabled')

0 comments on commit 155c088

Please sign in to comment.