1

Hello i use a raspberry pi Pico with RP2-80 20/34 P64M15.00 TTT chip with circuitpython 7.3.1 programing language and when i try to use pulseio module to capture a signal from a IR sensor i get that error,how can i fix this?

This is my code:

import board
import pulseio
import array

while True:
   ir_read=pulseio.PulseIn(board.GP7,maxlen=100,idle_state=True)
   command_on=array.array('H',[ir_read[x] for x in range(len(ir_read))])
   print(command_on)

This is the error:

Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
ValueError: GP7 in use

1 Answer 1

0

I figured out what the problem was, it was just my mistake :))

I hope this can help someone:

import board
import pulseio
import adafruit_irremote

pulses = pulseio.PulseIn(board.GP3, maxlen=200, idle_state=True)
decoder = adafruit_irremote.GenericDecode()
pulses.clear()
pulses.resume()
while True:
   detected = decoder.read_pulses(pulses)
   print(f'got a pulse... {detected}')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.