Skip to content

Commit 9e610e2

Browse files
Merge pull request #47 from arduino-libraries/karlsoderby/update-docs-nov
doc: update dac/adc.begin()
2 parents d99fc68 + 662972f commit 9e610e2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

docs/api.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ adc0.begin(resolution, sample_rate, n_samples, n_buffers)
3535

3636
#### Parameters
3737

38-
- `enum` - resolution (choose from 8, 10, 12, 14, 16 bit)
38+
- `enum` - analog read resolution (choose from 8, 10, 12, 14, 16 bit).
3939
- `AN_RESOLUTION_8`
4040
- `AN_RESOLUTION_10`
4141
- `AN_RESOLUTION_12`
4242
- `AN_RESOLUTION_14`
4343
- `AN_RESOLUTION_16`
44-
- `int` - frequency
45-
- `int` - n_samples
46-
- `int` - n_buffers
44+
- `int` - **sample_rate** - the sample rate / frequency in Hertz, e.g. `16000`.
45+
- `int` - **n_samples** - number of samples we want to acquire, e.g. `32`. When reading the ADC, we store these samples into a specific buffer (see [SampleBuffer](#samplebuffer)), and read them via `buffer[x]`, where `x` is the sample you want to retrieve.
46+
- `int` - **n_buffers** - the number of buffers in the queue.
4747

4848
#### Returns
4949

@@ -126,9 +126,10 @@ dac0.begin(resolution, frequency, n_samples, n_buffers)
126126
- `AN_RESOLUTION_8`
127127
- `AN_RESOLUTION_10`
128128
- `AN_RESOLUTION_12`
129-
- `int` - frequency
130-
- `int` - n_samples
131-
- `int` - n_buffers
129+
- `int` - **frequency** - the frequency in Hertz, e.g. `8000`.
130+
- `int` - **n_samples** - number of samples we want to write, e.g. `32`. When writing to the DAC, we first write the samples into a buffer (see [SampleBuffer](#samplebuffer)), and write it to the DAC using `dac_out.write(buf)`.
131+
- `int` - **n_buffers** - the number of buffers in the queue.
132+
132133

133134
#### Returns
134135

0 commit comments

Comments
 (0)