Closed stellaaa42 closed 2 years ago
@Space48121111 This PR is asking to merge master into another (deprecated) branch. That's probably not what you intended. Please check the branches to merge (just below the PR title).
Replaced with a new formatted pull request.
Arduino_Uno_Wifi_Rev2_Firmata.zip
Arduino Uno Wifi Rev 2 Board Configured For Pyfirmata
Major Changes:
Added pinouts to boards.h
(mac: ./Documents/Arduino/libraries/Firmata)
Added HWSerial port ID to SerialFirmata.h
(mac: ./Documents/Arduino/libraries/Firmata/utility/SerialFirmata.h)
boards.h
`//Arduino Uno Wifi Rev2
elif defined(__AVR_ATmega4809__)
define TOTAL_ANALOG_PINS NUM_ANALOG_INPUTS //6
define TOTAL_PINS 41 // 14 digital + 6 analog + 6 reserved + 10 internal used + 2 I2C + 3 SPI
define TOTAL_PORTS 3
define VERSION_BLINK_PIN LED_BUILTIN //25
define PIN_SERIAL1_RX 0
define PIN_SERIAL1_TX 1
define PIN_SERIAL2_RX 23
define PIN_SERIAL2_TX 24
define PIN_SERIAL0_RX 26
define PIN_SERIAL0_TX 27
define IS_PIN_DIGITAL(p) (((p) >= 0 && (p) < 20) || (p) == 25)
define IS_PIN_ANALOG(p) ((p) >= 14 && (p) < 19)
define IS_PIN_PWM(p) digitalPinHasPWM(p)
define IS_PIN_SERVO(p) ((p) >= 0 && (p) < MAX_SERVOS)
define IS_PIN_I2C(p) ((p) == 20 || (p) == 21)
define IS_PIN_SPI(p) ((p) == SS || (p) == MOSI || (p) == MISO || (p) == SCK)
define IS_PIN_SERIAL(p) ((p) == 23 || (p) == 24 || (p) == 26 || (p) == 27)
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)
// anything else
else
error "Please edit Boards.h with a hardware abstraction for this board"
endif`
SerialFirmata.h
`// map configuration query response resolution value to serial pin type
define RES_RX0 0x00
define RES_TX0 0x01
define RES_RX1 0x02
define RES_TX1 0x03
if defined(PIN_SERIAL0_RX)
endif
if defined(PIN_SERIAL1_RX)
endif
if defined(PIN_SERIAL0_RX)
endif
`