Skip to content

Instantly share code, notes, and snippets.

@soundanalogous
Last active December 2, 2020 13:34
Show Gist options
  • Save soundanalogous/ef246e80464aca1d0173506cb91c48c0 to your computer and use it in GitHub Desktop.
Save soundanalogous/ef246e80464aca1d0173506cb91c48c0 to your computer and use it in GitHub Desktop.
Arduino Nano Every Firmata Boards.h definition
// Unverified
#elif defined(AVR_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
@haraguro3
Copy link

Hello,
Tell us about "Standard Firmata" Library on Arduino Nano Every.
How do I avoid errors?

The following compilation error occurs:

Error while detecting libraries included by
C:\Program Files (x86)\Arduino\libraries\Firmata\Firmata.cpp

Error while detecting libraries included by
C:\Program Files (x86)\Arduino\libraries\Firmata\utility\SerialFirmata.cpp

In file included from
C:\Program Files (x86)\Arduino\libraries\Firmata/Firmata.h:17:0,
from
C:\Program Files (x86)\Arduino\libraries\Firmata\examples\StandardFirmata\StandardFirmata.ino:28:
C:\Program Files (x86)\Arduino\libraries\Firmata/Boards.h
:870:2: error: #error
"Please edit Boards.h with a hardware abstraction for this board"
#error
"Please edit Boards.h with a hardware abstraction for this board"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment