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

Commit ef67d2d

Browse files
committed
2 parents 480c79b + 996016a commit ef67d2d

File tree

5 files changed

+101
-86
lines changed

5 files changed

+101
-86
lines changed

LICENSE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Copyright 2020 MbientLab Inc. All rights reserved.
2+
3+
IMPORTANT: Your use of this Software is limited to those specific rights granted under the terms of a software license agreement between the user who downloaded the software, his/her employer (which must be your employer) and MbientLab Inc, (the "License").
4+
You may not use this Software unless you agree to abide by the terms of the License which can be found at www.mbientlab.com/terms.
5+
The License limits your use, and you acknowledge, that the Software may be modified, copied, and distributed when used in conjunction with an MbientLab Inc, product.
6+
Other than for the foregoing purpose, you may not use, reproduce, copy, prepare derivative works of, modify, distribute, perform, display or sell this Software and/or its documentation for any purpose.
7+
8+
YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MBIENTLAB OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
9+
10+
Should you have any questions regarding your right to use this Software, contact MbientLab via email: [email protected].

LICENSE.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# MetaWear SDK for Python by MBIENTLAB
2+
3+
[![Platforms](https://img.shields.io/badge/platform-linux--64%20%7C%20win--32%20%7C%20osx--64%20%7C%20win--64-lightgrey?style=flat)](https://github.com/mbientlab/MetaWear-SDK-Python)
4+
[![License](https://img.shields.io/cocoapods/l/MetaWear.svg?style=flat)](https://mbientlab.com/license)
5+
[![Version](https://img.shields.io/badge/python-3.5%20%7C%203.6%20%7C%203.7-blue?style=flat)](https://github.com/mbientlab/MetaWear-SDK-Python)
6+
7+
![alt tag](https://raw.githubusercontent.com/mbientlab/MetaWear-SDK-iOS-macOS-tvOS/master/Images/Metawear.png)
8+
9+
SDK for creating MetaWear apps on the Linux platform. This is a thin wrapper around the [MetaWear C++ API](https://github.com/mbientlab/MetaWear-SDK-Cpp) so you will find the C++ [documentation](https://mbientlab.com/cppdocs/latest/) and [API reference](https://mbientlab.com/docs/metawear/cpp/latest/globals.html) useful.
10+
11+
Also, check out the scripts in the [examples](https://github.com/mbientlab/MetaWear-SDK-Python/tree/master/examples) folder for sample code.
12+
13+
> ADDITIONAL NOTES
14+
This is not the pymetawear package. That is a community developed Python SDK which you can find over [here](https://github.com/mbientlab-projects/pymetawear).
15+
16+
### Overview
17+
18+
[MetaWear](https://mbientlab.com) is a complete development and production platform for wearable and connected device applications.
19+
20+
MetaWear features a number of sensors and peripherals all easily controllable over Bluetooth 4.0 Low Energy using this SDK, no firmware or hardware experience needed!
21+
22+
The MetaWear hardware comes pre-loaded with a wirelessly upgradeable firmware, so it keeps getting more powerful over time.
23+
24+
### Requirements
25+
- [MetaWear board](https://mbientlab.com/store/)
26+
- A linux or Windows 10+ machine with Bluetooth 4.0
27+
28+
### License
29+
See the [License](https://github.com/mbientlab/MetaWear-SDK-Python/blob/master/LICENSE).
30+
31+
### Support
32+
Reach out to the [community](https://mbientlab.com/community/) if you encounter any problems, or just want to chat :)
33+
34+
## Getting Started
35+
36+
### Installation
37+
38+
Use pip to install the metawear package. It depends on [PyWarble](https://github.com/mbientlab/PyWarble) so ensure your target environment has the necessary [dependencies](https://github.com/mbientlab/Warble#build) installed.
39+
40+
```ruby
41+
pip install metawear
42+
```
43+
44+
### Usage
45+
46+
Import the MetaWear class and libmetawear variable from the metawear module and everything from the cbindings module.
47+
```python
48+
from mbientlab.metawear import MetaWear, libmetawear
49+
from mbientlab.metawear.cbindings import *
50+
```
51+
52+
If you do not know the MAC address of your device, use ``PyWarble`` to scan for nearby devices.
53+
```python
54+
from mbientlab.warble import *
55+
from mbientlab.metawear import *
56+
from threading import Event
57+
58+
e = Event()
59+
address = None
60+
def device_discover_task(result):
61+
global address
62+
if (result.has_service_uuid(MetaWear.GATT_SERVICE)):
63+
# grab the first discovered metawear device
64+
address = result.mac
65+
e.set()
66+
67+
BleScanner.set_handler(device_discover_task)
68+
BleScanner.start()
69+
e.wait()
70+
71+
BleScanner.stop()
72+
```
73+
74+
Once you have the device's MAC address, create a MetaWear object with the MAC address and connect to the device.
75+
```python
76+
device = MetaWear(address)
77+
device.connect()
78+
```
79+
80+
Upon a successful connection, you can begin calling any of the functions from the C++ SDK, for example, blinking the LED green.
81+
```python
82+
pattern= LedPattern(repeat_count= Const.LED_REPEAT_INDEFINITELY)
83+
libmetawear.mbl_mw_led_load_preset_pattern(byref(pattern), LedPreset.BLINK)
84+
libmetawear.mbl_mw_led_write_pattern(device.board, byref(pattern), LedColor.GREEN)
85+
libmetawear.mbl_mw_led_play(device.board)
86+
```
87+
88+
### Tutorials
89+
90+
Tutorials can be found [here](https://mbientlab.com/tutorials/).

README.rst

Lines changed: 0 additions & 64 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import platform
1010
import sys
1111

12-
machine = os.environ['MACHINE'] if 'MACHINE' in os.environ else ("arm" if "arm" in platform.machine() else ("x64" if sys.maxsize > 2**32 else "x86"))
12+
machine = os.environ['MACHINE'] if 'MACHINE' in os.environ else ("arm" if ("arm" in platform.machine()) or ("aarch64" in platform.machine()) else ("x64" if sys.maxsize > 2**32 else "x86"))
1313
root = os.path.dirname(os.path.abspath(__file__))
1414
dest = os.path.join("mbientlab", "metawear")
1515

0 commit comments

Comments
 (0)