Skip to content

Commit ace109f

Browse files
committed
Update the examples for busio.
1 parent 839c67f commit ace109f

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

examples/servo.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import time
22

33
from board import *
4-
# Use this import for ESP8266 and other boards with software I2C interfaces:
5-
import bitbangio as io
6-
# Or use this import for SAMD21 and boards with a native hardware I2C interace:
7-
#import nativeio as io
4+
import busio
85

96
# Import the PCA9685 servo module.
107
from adafruit_pca9685 import servo
118

129

1310
# Create the I2C bus interface.
14-
i2c = io.I2C(SCL, SDA)
11+
i2c = busio.I2C(SCL, SDA)
1512

1613
# Create a simple PCA9685 class instance.
1714
servos = servo.Servos(i2c)

examples/simpletest.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
from board import *
2-
# Use this import for ESP8266 and other boards with software I2C interfaces:
3-
import bitbangio as io
4-
# Or use this import for SAMD21 and boards with a native hardware I2C interace:
5-
#import nativeio as io
2+
import busio
63

74
# Import the PCA9685 module.
85
from adafruit_pca9685 import pca9685
96

10-
117
# Create the I2C bus interface.
12-
i2c = io.I2C(SCL, SDA)
8+
i2c = busio.I2C(SCL, SDA)
139

1410
# Create a simple PCA9685 class instance.
1511
pca = pca9685.PCA9685(i2c)

0 commit comments

Comments
 (0)