Hi community, i tried to compile this code on my xiao sense with arduino IDE
bool lightOn = false;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
// make the pushbutton's pin an input:
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// print out the state of the button:
if(Serial.available())
{
char c = Serial.read();
if (c)
{
if(c == 'A')
{
lightOn = true;
}
else if(c == 'Z')
{
lightOn = false;
}
c = NULL;
}
}
if(lightOn)
{
digitalWrite(LED_BUILTIN, HIGH);
Serial.println("on");
}
else
{
digitalWrite(LED_BUILTIN, LOW);
Serial.println("off");
}
delay(1000); // delay in between reads for stability
}
but when i compile this the ide return this error
c:/users/damhir/documents/arduinodata/packages/seeeduino/tools/arm-none-eabi-gcc/9-2019q4/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: sketch\sketch_aug15a.ino.cpp.o: in function loop': C:\Users\Damhir\Documents\Arduino\sketch_aug15a/sketch_aug15a.ino:7: undefined reference to
Adafruit_USBD_CDC::available()’
c:/users/damhir/documents/arduinodata/packages/seeeduino/tools/arm-none-eabi-gcc/9-2019q4/bin/…/lib/gcc/arm-none-eabi/9.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: C:\Users\Damhir\Documents\Arduino\sketch_aug15a/sketch_aug15a.ino:9: undefined reference to Adafruit_USBD_CDC::read()' c:/users/damhir/documents/arduinodata/packages/seeeduino/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Damhir\Documents\Arduino\sketch_aug15a/sketch_aug15a.ino:23: undefined reference to
Serial’
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compilando para la tarjeta Seeed XIAO nRF52840 Sense.
maybe can help me?