Skip to content

Commit 46d5c4f

Browse files
author
Aditya Jain
committed
2 parents d9ba35e + e8eac11 commit 46d5c4f

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
<p align="center"><img src ="https://github.com/pycom/pycom-libraries/blob/master/img/logo.png" width="300"></p>
22

3-
# Introduction
4-
This repository contains out of the box examples for Pycom devices, including Pysense and Pytrack.
3+
# Pycom Libraries and Examples
54

6-
# Table of Contents
5+
## Introduction
6+
This repository contains out of the box examples for Pycom devices, including Pysense, Pytrack, and Pyscan.
7+
8+
## Table of Contents
79
* [Examples](/examples)
810
* [Libraries](/lib)
911
* [Pysense](/pysense)
1012
* [Pytrack](/pytrack)
13+
* [Pyscan](/pyscan)
14+
* [Pybytes](/pybytes)
1115

12-
# Pysense & Pytrack
16+
## Pysense, Pytrack, Pyscan
1317

14-
To install the required libraries for Pysense & Pytrack, please download this repo as a ZIP file. You will then be able to extract and upload the library files to your Pycom device (via FTP or Pymakr Plugin). Please see https://docs.pycom.io for more information.
18+
To install the required libraries for Pysense, Pytrack, and Pyscan, please download this repo as a ZIP file. You will then be able to extract and upload the library files to your Pycom device (via FTP or Pymakr Plugin). Please see [docs.pycom.io](https://docs.pycom.io) for more information.
1519

16-
# Links
20+
## Links
1721
* [Pycom](https://pycom.io)
1822
* [Forum](https://forum.pycom.io)
1923
* [Docs](https://docs.pycom.io)

examples/bluetooth/main.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
from network import Bluetooth
2+
import binascii
23
import time
34
bt = Bluetooth()
45
bt.start_scan(-1)
56

67
while True:
78
adv = bt.get_adv()
8-
if adv
9+
if adv:
910
# try to get the complete name
10-
print(bluetooth.resolve_adv_data(adv.data, Bluetooth.ADV_NAME_CMPL))
11+
print(bt.resolve_adv_data(adv.data, Bluetooth.ADV_NAME_CMPL))
1112

1213
# try to get the manufacturer data (Apple's iBeacon data is sent here)
13-
print(binascii.hexlify(bluetooth.resolve_adv_data(adv.data, Bluetooth.ADV_MANUFACTURER_DATA)))
14+
mfg_data = bt.resolve_adv_data(adv.data, Bluetooth.ADV_MANUFACTURER_DATA)
15+
16+
if mfg_data:
17+
# try to get the manufacturer data (Apple's iBeacon data is sent here)
18+
print(binascii.hexlify(mfg_data))
1419

15-
1620
if bt.resolve_adv_data(adv.data, Bluetooth.ADV_NAME_CMPL) == 'Heart Rate':
1721
conn = bt.connect(adv.mac)
1822
services = conn.services()
@@ -29,4 +33,4 @@
2933
conn.disconnect()
3034
break
3135
else:
32-
time.sleep(0.050)
36+
time.sleep(0.050)

pybytes/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<p align="center"><img src ="https://github.com/pycom/pycom-libraries/blob/master/img/logo.png" width="300"></p>
2+
3+
# Pybytes Examples
4+
5+
Please note that these examples only work when using the `pybytes` firmware.

pyscan/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def print_debug(msg):
4747
print(msg)
4848

4949
def send_sensor_data(name, timeout):
50-
while(pybytes):
51-
pybytes.send_virtual_pin_value(True, 2, lt.light())
52-
pybytes.send_virtual_pin_value(True, 3, li.acceleration())
50+
while(true):
51+
print(lt.light())
52+
print(li.acceleration())
5353
time.sleep(timeout)
5454

5555
def discovery_loop(nfc, id):

0 commit comments

Comments
 (0)