Skip to content

Commit b6d868e

Browse files
committed
Merge branch 'dev' into staging
2 parents 9461126 + d918384 commit b6d868e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@ $ python3 -m pip install edgepi-python-sdk
1919
## Example Code
2020
The EdgePi SDK provides a wide range of functionality to users, allowing interaction with the many modules onboard the EdgePi. One such module, the ADC, can be used to read voltage continuously from any of the eight EdgePi analog input pins:
2121

22-
```
23-
from edgepi.adc.edgepi_adc import EdgePiADC
24-
from edgepi.adc.adc_constants import ADCChannel, ConvMode, ADCNum
22+
```python
23+
from edgepi.dac.edgepi_adc import EdgePiADC
24+
from edgepi.adc.adc_constants import ADCChannel, ConvMode
2525

2626
# initialize ADC
2727
edgepi_adc = EdgePiADC()
2828

29-
# configure ADC to sample analog input pin AIN3
29+
# configure ADC to sample input pin 4 (the input pins are 0-indexed)
3030
edgepi_adc.set_config(adc_1_analog_in=ADCChannel.AIN3, conversion_mode=ConvMode.CONTINUOUS)
3131

32-
# send command to start continuous conversions
33-
edgepi_adc.start_conversions(ADCNum.ADC_1)
32+
# send command to start automatic conversions
33+
edgepi_adc.start_conversions()
3434

3535
# perform 10 voltage reads
3636
for _ in range(10):
37-
out = edgepi_adc.read_voltage(ADCNum.ADC_1)
37+
out = edgepi_adc.read_voltage()
3838
print(out)
3939

40-
# stop continuous conversions
41-
edgepi_adc.stop_conversions(ADCNum.ADC_1)
40+
# stop automatic conversions
41+
edgepi_adc.stop_conversions()
4242
```
4343
For further details on this and other modules, please refer to each module's documentation by following the links provided in the `Implemented Modules` section below.
4444
# Implemented Modules

0 commit comments

Comments
 (0)