Skip to content

Commit 0193141

Browse files
committed
Merge branch 'dhalbert-master'
2 parents 33c364d + e14c153 commit 0193141

File tree

5 files changed

+420
-10
lines changed

5 files changed

+420
-10
lines changed

.travis.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Travis CI configuration for automated .mpy file generation.
2+
# Author: Tony DiCola
3+
# License: Public Domain
4+
# This configuration will work with Travis CI (travis-ci.org) to automacially
5+
# build .mpy files for MicroPython when a new tagged release is created. This
6+
# file is relatively generic and can be shared across multiple repositories by
7+
# following these steps:
8+
# 1. Copy this file into a .travis.yml file in the root of the repository.
9+
# 2. Change the deploy > file section below to list each of the .mpy files
10+
# that should be generated. The config will automatically look for
11+
# .py files with the same name as the source for generating the .mpy files.
12+
# Note that the .mpy extension should be lower case!
13+
# 3. Commit the .travis.yml file and push it to GitHub.
14+
# 4. Go to travis-ci.org and find the repository (it needs to be setup to access
15+
# your github account, and your github account needs access to write to the
16+
# repo). Flip the 'ON' switch on for Travis and the repo, see the Travis
17+
# docs for more details: https://docs.travis-ci.com/user/getting-started/
18+
# 5. Get a GitHub 'personal access token' which has at least 'public_repo' or
19+
# 'repo' scope: https://help.github.com/articles/creating-an-access-token-for-command-line-use/
20+
# Keep this token safe and secure! Anyone with the token will be able to
21+
# access and write to your GitHub repositories. Travis will use the token
22+
# to attach the .mpy files to the release.
23+
# 6. In the Travis CI settings for the repository that was enabled find the
24+
# environment variable editing page: https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
25+
# Add an environment variable named GITHUB_TOKEN and set it to the value
26+
# of the GitHub personal access token above. Keep 'Display value in build
27+
# log' flipped off.
28+
# 7. That's it! Tag a release and Travis should go to work to add .mpy files
29+
# to the release. It takes about a 2-3 minutes for a worker to spin up,
30+
# build mpy-cross, and add the binaries to the release.
31+
language: generic
32+
33+
sudo: true
34+
35+
deploy:
36+
provider: releases
37+
api_key: $GITHUB_TOKEN
38+
file:
39+
- "adafruit_amg88xx.mpy"
40+
skip_cleanup: true
41+
on:
42+
tags: true
43+
44+
before_install:
45+
- sudo apt-get -yqq update
46+
- sudo apt-get install -y build-essential git python python-pip
47+
- git clone https://github.com/adafruit/micropython.git
48+
- make -C micropython/mpy-cross
49+
- export PATH=$PATH:$PWD/micropython/mpy-cross/
50+
- sudo pip install shyaml
51+
52+
before_deploy:
53+
- shyaml get-values deploy.file < .travis.yml | sed 's/.mpy/.py/' | xargs -L1 mpy-cross
54+

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,39 @@ Of course, you must import the library to use it:
1212

1313
```
1414
import busio
15-
import Adafruit_AMG88xx
15+
import adafruit_amg88xx
1616
```
1717
The way to create an I2C object depends on the board you are using. For boards with labeled SCL and SDA pins, you can:
1818

1919
```
20-
from board import *
20+
import board
2121
```
2222

2323
You can also use pins defined by the onboard microcontroller through the microcontroller.pin module.
2424

2525
Now, to initialize the I2C bus:
2626

2727
```
28-
myI2C = busio.I2C(SCL, SDA)
28+
myI2C = busio.I2C(board.SCL, board.SDA)
2929
```
3030

3131
Once you have created the I2C interface object, you can use it to instantiate the AMG88xx object
3232

3333
```
34-
amg = Adafruit_AMG88xx.Adafruit_AMG88xx(myI2C)
34+
amg = adafruit_amg88xx.Adafruit_AMG88xx(myI2C)
3535
```
3636

3737
You can also optionally use the alternate i2c address (make sure to solder the jumper on the back of the board if you want to do this)
3838

3939
```
40-
amg = Adafruit_AMG88xx.Adafruit_AMG88xx(myI2C, addr=0x68)
40+
amg = adafruit_amg88xx.Adafruit_AMG88xx(myI2C, addr=0x68)
4141
```
4242

4343
# Reading Pixels
4444

4545
Pixels can be then be read by doing:
4646

4747
```
48-
value = a.readPixels()
48+
value = amg.readPixels()
4949
print(value)
5050
```

Adafruit_AMG88xx.py renamed to adafruit_amg88xx.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ class is inherited by the chip-specific subclasses.
4242
"""
4343

4444
from adafruit_bus_device.i2c_device import I2CDevice
45-
from adafruit_register import i2c_bit
46-
from adafruit_register import i2c_bits
47-
from adafruit_register import i2c_bcd_alarm
48-
from adafruit_register import i2c_bcd_datetime
45+
from adafruit_register import i2c_bit, i2c_bints
4946

5047
"""
5148
# AMG88xx default address.

api.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
.. automodule:: adafruit_amg88xx
3+
:members:

0 commit comments

Comments
 (0)