Oleg Chumakov
Published

battlehack-do

Python/Django demonstration of usage WunderBar by Relayr

Full instructions provided905
battlehack-do

Things used in this project

Hardware components

WunderBar
Relayr WunderBar
×1

Story

Read more

Code

file_8322.python

Python
Connecting to hack.py code from any place, e.g. django start urls call (https://github.com/the21/do/blob/master/doapi/hack.py)
    sl = hack.SensorListener()
    sl.add_callback(l.onDataReceived, None)
    sl.launch()

file_8324.python

Python
Receiving data from relayr API (https://github.com/the21/do/blob/34f8022ac41861b7f091e65c35f9051842e89032/doapi/logic.py)
    def onDataReceived(self,data):
        t, v = DataType.getType(data)
        # print "type %s val %s" %( t, v)

        de = DataEntry(d_type=t, value=v)
        de.save()
        self.tryDetectEvent(de)

Github

Credits

Oleg Chumakov

Oleg Chumakov

1 project • 0 followers

Comments

Add projectSign up / Login