File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 17
17
import time
18
18
from micropython import const
19
19
from adafruit_bus_device .i2c_device import I2CDevice
20
- from busio import I2C
21
- from microcontroller import Pin
22
20
23
21
try :
24
22
from typing import Optional
23
+ from busio import I2C
24
+ from microcontroller import Pin
25
25
except ImportError :
26
26
pass
27
27
@@ -58,7 +58,7 @@ def __init__(
58
58
self ,
59
59
i2c : I2C ,
60
60
gain : float = 1 ,
61
- data_rate : Optional [float ] = None ,
61
+ data_rate : Optional [int ] = None ,
62
62
mode : Mode = Mode .SINGLE ,
63
63
address : int = _ADS1X15_DEFAULT_ADDRESS ,
64
64
):
@@ -77,7 +77,7 @@ def data_rate(self):
77
77
return self ._data_rate
78
78
79
79
@data_rate .setter
80
- def data_rate (self , rate : float ):
80
+ def data_rate (self , rate : int ):
81
81
possible_rates = self .rates
82
82
if rate not in possible_rates :
83
83
raise ValueError ("Data rate must be one of: {}" .format (possible_rates ))
Original file line number Diff line number Diff line change 11
11
* Author(s): Carter Nelson, adapted from MCP3xxx original by Brent Rubell
12
12
"""
13
13
14
- from .ads1x15 import ADS1x15
15
-
16
14
try :
17
15
from typing import Optional
16
+ from .ads1x15 import ADS1x15
18
17
except ImportError :
19
18
pass
20
19
You can’t perform that action at this time.
0 commit comments