Hi, I have just started development with the new Arduino Nano RP2040 Connect board, installed the board and created the classic blink test project that blinks the built in LED. This compiles, and works as expected.
I then tried to use the built in RGB led, installed the WifiNINA library and write the following code:
#include <Arduino.h>
#include <WiFiNINA.h>
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(LEDR, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
digitalWrite(LEDR, HIGH); //RED
delay(1000);
digitalWrite(LEDR, LOW); //RED
delay(1000);
}
However this does not compile, giving errors:
c:/users/heikk/.platformio/packages/toolchain-gccarmnoneeabi/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: .pio\build\nanorp2040connect\src\main.cpp.o: in function setup': main.cpp:(.text.setup+0xe): undefined reference to
pinMode(NinaPin, PinMode)’
c:/users/heikk/.platformio/packages/toolchain-gccarmnoneeabi/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: .pio\build\nanorp2040connect\src\main.cpp.o: in function loop': main.cpp:(.text.loop+0x26): undefined reference to
digitalWrite(NinaPin, PinStatus)’
c:/users/heikk/.platformio/packages/toolchain-gccarmnoneeabi/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: main.cpp:(.text.loop+0x34): undefined reference to `digitalWrite(NinaPin, PinStatus)’
functions pinMode and digitalWrite should call overloaded versions with NinaPin argument, but what is wrong here ?
The code is taken from Arduino documentation and presumably works using Arduino IDE.