Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

pin_counter on raspi pico
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

pin_counter on raspi pico

by Geoff138 on Mon Mar 15, 2021 6:28 am

I installed CircuitPython 6.2.0 Beta 3 on a Pico
if I use pin_counter = countio.Counter(board.GP0)
it gives a run time error :-
Pin must be on PWM Channel B
What pins can I use with pin_counter ?

Geoff

Geoff138
 
Posts: 2
Joined: Mon Mar 15, 2021 6:13 am

Re: pin_counter on raspi pico

by tannewt on Mon Mar 15, 2021 6:41 pm

Channel B is on every odd pin number. (Even pins are channel A.)

tannewt
 
Posts: 2389
Joined: Thu Oct 06, 2016 8:48 pm

Re: pin_counter on raspi pico

by Geoff138 on Tue Mar 16, 2021 4:32 am

I tried pin_counter = countio.Counter(board.GP1)
but now I get :-
RuntimeError: PWM slice already in use ?

Geoff138
 
Posts: 2
Joined: Mon Mar 15, 2021 6:13 am

Re: pin_counter on raspi pico

by tannewt on Tue Mar 16, 2021 12:16 pm

Please post your entire code. The PWM slice of GP1 is shared with GP17 because there are only 8 total, two channels each.

tannewt
 
Posts: 2389
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.