Skip to content

Nunchuk.h nunchuk_init_power() uses AVR ports which is invalid for ARM and ESP Boards #4

@dsyleixa

Description

@dsyleixa

hi,
apart from faulty i2c readings on ARM boards, another crucial issue to the nunchuk.h lib:
Nunchuk.h nunchuk_init_power() uses AVR ports which is invalid for ARM and ESP Boards

static void nunchuk_init_power() {
    // Add power supply for port C2 (GND) and C3 (PWR)
    PORTC &= ~_BV(PORTC2);
    PORTC |= _BV(PORTC3);
    DDRC |= _BV(PORTC2) | _BV(PORTC3);
    delay(100);
}
#endif

why don't you use the standard Arduino port numbers A0...A4 instead?
(edit: for ESP then perhaps digital output pins)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions