PaulStoffregen / Encoder

Quadrature Encoder Library for Arduino
http://www.pjrc.com/teensy/td_libs_Encoder.html
568 stars 245 forks source link

No support for Arduino nano rp2040 connect #79

Open balta1980 opened 2 years ago

balta1980 commented 2 years ago

Please use this form only to report code defects or bugs.

For any question, even questions directly pertaining to this code, post your question on the forums related to the board you are using.

Arduino: forum.arduino.cc Teensy: forum.pjrc.com ESP8266: www.esp8266.com ESP32: www.esp32.com Adafruit Feather/Metro/Trinket: forums.adafruit.com Particle Photon: community.particle.io

If you are experiencing trouble but not certain of the cause, or need help using this code, ask on the appropriate forum. This is not the place to ask for support or help, even directly related to this code. Only use this form you are certain you have discovered a defect in this code!

Please verify the problem occurs when using the very latest version, using the newest version of Arduino and any other related software.

----------------------------- Remove above -----------------------------

Description

Describe your problem. No support for Arduino nano rp2040 connect

Steps To Reproduce Problem

Please give detailed instructions needed for anyone to attempt to reproduce the problem.

try to compile the basic example will fail, it will says the board does not have interrupt pins try to use no interrupt example also fails.

Hardware & Software

Board Arduino nano rp2040 connect Shields / modules used no Arduino IDE version 1.8.19 Teensyduino version (if using Teensy) Version info & package name (from Tools > Boards > Board Manager) 3.0.0 for Mbed os nano Operating system & version windows 11 22581.200 Any other software or hardware?

Arduino Sketch

// Change the code below by your sketch (please try to give the smallest code which demonstrates the problem)
#include <Arduino.h>

// libraries: give links/details so anyone can compile your code for the same result

void setup() {
}

void loop() {
}

Errors or Incorrect Output

If you see any errors or incorrect output, please show it here. Please use copy & paste to give an exact copy of the message. Details matter, so please show (not merely describe) the actual message or error exactly as it appears.

roman-rs commented 2 years ago

It works fine to me. please double check that you're using the latest library version. check the header files, e.g. https://github.com/PaulStoffregen/Encoder/blob/master/utility/interrupt_pins.h in the latest version in contains the block for rp2040 connect like: // Arduino Nano RP2040 Connect

elif defined(ARDUINO_NANO_RP2040_CONNECT)

define CORE_NUM_INTERRUPT 20

define CORE_INT0_PIN 0

define CORE_INT1_PIN 1

define CORE_INT2_PIN 2

define CORE_INT3_PIN 3

....

balta1980 commented 2 years ago

Thank you, I am going to check lib version and try again.

PaulStoffregen commented 2 years ago

interrupt_pins.h was updated some time ago with defines for ARDUINO_NANO_RP2040_CONNECT.

Is this issue resolved?

kusnezow commented 2 years ago

For me it works fine if:

  1. I download the latest master branch from github (it seems there is no release with the rpi 2040 changes yet, 1.4.2 does not have them)
  2. I manually define ARDUINO_NANO_RP2040_CONNECT as extra compiler flags. I have a rpi pico and this define is not set automatically.

After that it works like a charm.