Skip to content

Commit 0bad0fb

Browse files
author
Kevin J Walters
committed
Using A2/GP28 for Raspberry Pi Pico analogue input pin.
1 parent a8f4354 commit 0bad0fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adc/adc-comparison/adc-test-1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### adc-test-1 v1.0
1+
### adc-test-1 v1.1
22
### Print values from ADC to compare between boards
33
### Reads from A5, sets A0 on SAMD21 only
44

@@ -46,8 +46,8 @@ def repeat(value, cnt):
4646
for _ in range(cnt):
4747
yield value
4848

49-
50-
input_pin = board.A5
49+
### A2 is GP28 on Raspberry Pi Pico (RP2040)
50+
input_pin = board.A2 if SYSNAME == "rp2040" else board.A5
5151
output_pin = board.A0 if SYSNAME == "samd21" else None
5252
OUTPUT_DAC_BITS = 10
5353

0 commit comments

Comments
 (0)