Add ds18b20 udp broadcaster example.
Add license and readme details. Rid of compile-time switches. Rid of lazy initialization of sensor. Minor code fixing.
This commit is contained in:
parent
1da8626e6e
commit
72f30ad950
13 changed files with 278 additions and 102 deletions
20
examples/ds18b20_broadcaster/README.md
Normal file
20
examples/ds18b20_broadcaster/README.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# DS19B20 Broadcaster
|
||||
|
||||
>In this example you can see how to get data from multiple
|
||||
>ds18b20 sensor and emit result over udb broadcaster address.
|
||||
|
||||
As a client server, you can use this simple udp receiver, writen in python:
|
||||
|
||||
```
|
||||
import select, socket
|
||||
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
s.bind(('<broadcast>', 8005))
|
||||
s.setblocking(0)
|
||||
|
||||
while True:
|
||||
result = select.select([s],[],[])
|
||||
msg = result[0][0].recv(1024)
|
||||
print msg.strip()
|
||||
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue