Coder Social home page Coder Social logo

Comments (8)

pgrawehr avatar pgrawehr commented on May 24, 2024

Hi @ThorPrez

Please do the following: In the Arduino IDE, go to File->Preferences and enable verbose mode for compiling. Then run a build and copy the whole build output to a file. Attach this file here. The build output will contain the exact name of the preprocessor definition that is to be used.

from arduino.

ThorPrez avatar ThorPrez commented on May 24, 2024

Thanks for your feedback.
Where exactly can I see the right name for the board ?
Here are some examples of the output;

Arduino: 1.8.19 (Windows 10), Board: "Arduino Nano Every, None (ATMEGA4809)"

Using board 'nona4809' from platform in folder: C:\Users\Arbeitszimmer\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7
Using core 'arduino' from platform in folder: C:\Users\Arbeitszimmer\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7

Detecting libraries used...
.... mmcu=atmega4809 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO_EVERY -DARDUINO_ARCH_MEGAAVR ....

And here´s my edit:

// Arduino Nano Every
elif defined(AVR_NANO_EVERY) || elif defined(ARDUINO_NANO_EVERY)
#define TOTAL_ANALOG_PINS 8
#define TOTAL_PINS 24 // 14 digital + 8 analog + 2 i2c
#define IS_PIN_DIGITAL(p) ((p) >= 2 && (p) <= 21) // TBD if pins 0 and 1 are usable
#define IS_PIN_ANALOG(p) ((p) >= 14 && (p) < 14 + TOTAL_ANALOG_PINS)
#define IS_PIN_PWM(p) digitalPinHasPWM(p)
#define IS_PIN_SERVO(p) (IS_PIN_DIGITAL(p) && (p) < MAX_SERVOS) // deprecated since v2.4
#define IS_PIN_I2C(p) ((p) == PIN_WIRE_SDA || (p) == PIN_WIRE_SCL) // SDA = 22, SCL = 23
#define IS_PIN_SPI(p) ((p) == SS || (p) == MOSI || (p) == MISO || (p) == SCK)
#define PIN_TO_DIGITAL(p) (p)
#define PIN_TO_ANALOG(p) ((p) - 14)
#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p)
#define PIN_TO_SERVO(p) (p) // deprecated since v2.4

from arduino.

pgrawehr avatar pgrawehr commented on May 24, 2024

It's the parameters prefixed with "-D" (excluding the D itself). So try

#elif defined(AVR_NANO_EVERY) || defined(ARDUINO_NANO_EVERY) || defined(ARDUINO_AVR_NANO_EVERY)

from arduino.

pgrawehr avatar pgrawehr commented on May 24, 2024

Make sure you don't miss the # before elif

from arduino.

ThorPrez avatar ThorPrez commented on May 24, 2024

With # before Elif I'm having more faults

from arduino.

pgrawehr avatar pgrawehr commented on May 24, 2024

Then you probably have a syntax error. Try the line exactly as I specified above.

from arduino.

ThorPrez avatar ThorPrez commented on May 24, 2024

#elif defined(AVR_NANO_EVERY) || defined(ARDUINO_NANO_EVERY) || defined(ARDUINO_AVR_NANO_EVERY)

It works, thanks.
Now I can try to communicate with Pi and Arduino. But it seems, that Node-Red cannot communicate with the Nano Every. Serial node is working, Arduino node not.

from arduino.

pgrawehr avatar pgrawehr commented on May 24, 2024

I have updated the source and after fixing the typo this works, so closing the issue.

from arduino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.