Hi everybody,
I have successfully installed Seeeduino XIAO support for the Arduino-IDE 1.18.13
and the basic blink-program
works
void PrintFileNameDateTime() {
Serial.println("Code running comes from file ");
Serial.println(__FILE__);
Serial.print(" compiled ");
Serial.print(__DATE__);
Serial.print(" ");
Serial.println(__TIME__);
}
boolean TimePeriodIsOver (unsigned long &periodStartTime, unsigned long TimePeriod) {
unsigned long currentMillis = millis();
if ( currentMillis - periodStartTime >= TimePeriod )
{
periodStartTime = currentMillis; // set new expireTime
return true; // more time than TimePeriod) has elapsed since last time if-condition was true
}
else return false; // not expired
}
unsigned long MyTestTimer = 0; // variables MUST be of type unsigned long
const byte OnBoard_LED = LED_BUILTIN;
void BlinkHeartBeatLED(int IO_Pin, int BlinkPeriod) {
static unsigned long MyBlinkTimer;
pinMode(IO_Pin, OUTPUT);
if ( TimePeriodIsOver(MyBlinkTimer,BlinkPeriod) ) {
digitalWrite(IO_Pin,!digitalRead(IO_Pin) );
}
}
void setup() {
Serial.begin(115200);
Serial.println("Setup-Start");
PrintFileNameDateTime();
}
void loop() {
BlinkHeartBeatLED(OnBoard_LED,100);
if ( TimePeriodIsOver(MyTestTimer,1000) ) {
Serial.println("Hello World");
}
}
Onboard LED blinks serial output works.
Now next step I tried the USB-Keyboard-emulation with this simple code
#include "keyboard.h"
boolean TimePeriodIsOver (unsigned long &periodStartTime, unsigned long TimePeriod) {
unsigned long currentMillis = millis();
if ( currentMillis - periodStartTime >= TimePeriod )
{
periodStartTime = currentMillis; // set new expireTime
return true; // more time than TimePeriod) has elapsed since last time if-condition was true
}
else return false; // not expired
}
unsigned long MyTestTimer = 0; // variables MUST be of type unsigned long
void setup() {
Serial.begin(115200);
Serial.println("Setup-Start");
PrintFileNameDateTime();
Keyboard.begin();
}
void loop() {
if ( TimePeriodIsOver(MyTestTimer,1000) ) {
Keyboard.print( F"Hi I'm the keyboard-emulator") );
}
}
but I get the error-message
keyboard.h: No such file or directory
I'm using the Arduino-IDE 1.8.13 in a portable version.
Here is the complete compiler-output
Arduino: 1.8.13 (Windows 10), TD: 1.53, Board: "Seeeduino XIAO, Arduino, Off"
F:\MyPortable-PRgs\arduino1.8.13\arduino-builder -dump-prefs -logger=machine -hardware F:\MyPortable-PRgs\arduino1.8.13\hardware -hardware F:\MyPortable-PRgs\arduino1.8.13\portable\packages -hardware F:\MyPortable-PRgs\arduino1.8.13\portable\sketchbook\hardware -tools F:\MyPortable-PRgs\arduino1.8.13\tools-builder -tools F:\MyPortable-PRgs\arduino1.8.13\hardware\tools\avr -tools F:\MyPortable-PRgs\arduino1.8.13\portable\packages -libraries F:\MyPortable-PRgs\arduino1.8.13\portable\sketchbook\libraries -fqbn=Seeeduino:samd:seeed_XIAO_m0:usbstack=arduino,debug=off -vid-pid=2886_802F -ide-version=10813 -build-path C:\Users\dipl-\AppData\Local\Temp\arduino_build_886788 -warnings=all -build-cache C:\Users\dipl-\AppData\Local\Temp\arduino_cache_659107 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.arm-none-eabi-gcc-7-2017q4.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.bossac.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.7.0-arduino3 -prefs=runtime.tools.bossac-1.8.0-48-gb176eee.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.CMSIS.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS\5.4.0 -prefs=runtime.tools.CMSIS-5.4.0.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS\5.4.0 -prefs=runtime.tools.openocd.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.openocd-0.10.0-arduino7.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.arduinoOTA.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.bossac-1.7.0-arduino3.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.7.0-arduino3 -prefs=runtime.tools.CMSIS-Atmel.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1 -prefs=runtime.tools.CMSIS-Atmel-1.2.1.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1 -verbose F:\MyPortable-PRgs\arduino1.8.13\portable\sketchbook\Seeeduino-XIAO-Keyboard-Emulator-000-reduced\Seeeduino-XIAO-Keyboard-Emulator-000-reduced.ino
F:\MyPortable-PRgs\arduino1.8.13\arduino-builder -compile -logger=machine -hardware F:\MyPortable-PRgs\arduino1.8.13\hardware -hardware F:\MyPortable-PRgs\arduino1.8.13\portable\packages -hardware F:\MyPortable-PRgs\arduino1.8.13\portable\sketchbook\hardware -tools F:\MyPortable-PRgs\arduino1.8.13\tools-builder -tools F:\MyPortable-PRgs\arduino1.8.13\hardware\tools\avr -tools F:\MyPortable-PRgs\arduino1.8.13\portable\packages -libraries F:\MyPortable-PRgs\arduino1.8.13\portable\sketchbook\libraries -fqbn=Seeeduino:samd:seeed_XIAO_m0:usbstack=arduino,debug=off -vid-pid=2886_802F -ide-version=10813 -build-path C:\Users\dipl-\AppData\Local\Temp\arduino_build_886788 -warnings=all -build-cache C:\Users\dipl-\AppData\Local\Temp\arduino_cache_659107 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.arm-none-eabi-gcc-7-2017q4.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arm-none-eabi-gcc\7-2017q4 -prefs=runtime.tools.bossac.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.7.0-arduino3 -prefs=runtime.tools.bossac-1.8.0-48-gb176eee.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.8.0-48-gb176eee -prefs=runtime.tools.CMSIS.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS\5.4.0 -prefs=runtime.tools.CMSIS-5.4.0.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS\5.4.0 -prefs=runtime.tools.openocd.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.openocd-0.10.0-arduino7.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\arduino\tools\openocd\0.10.0-arduino7 -prefs=runtime.tools.arduinoOTA.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.bossac-1.7.0-arduino3.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\bossac\1.7.0-arduino3 -prefs=runtime.tools.CMSIS-Atmel.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1 -prefs=runtime.tools.CMSIS-Atmel-1.2.1.path=F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\tools\CMSIS-Atmel\1.2.1 -verbose F:\MyPortable-PRgs\arduino1.8.13\portable\sketchbook\Seeeduino-XIAO-Keyboard-Emulator-000-reduced\Seeeduino-XIAO-Keyboard-Emulator-000-reduced.ino
Using board 'seeed_XIAO_m0' from platform in folder: F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\hardware\samd\1.8.1
Using core 'arduino' from platform in folder: F:\MyPortable-PRgs\arduino1.8.13\portable\packages\Seeeduino\hardware\samd\1.8.1
Detecting libraries used...
"F:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\arm-none-eabi-gcc\\7-2017q4/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++14 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions "-D__SKETCH_NAME__=\"\"\"Seeeduino-XIAO-Keyboard-Emulator-000-reduced.ino\"\"\"" -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10813 -DARDUINO_SEEED_XIAO_M0 -DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" -DARDUINO_SAMD_ZERO -D__SAMD21__ -D__SAMD21G18A__ -DARM_MATH_CM0PLUS -DSEEED_XIAO_M0 -DUSB_VID=0x2886 -DUSB_PID=0x802F -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Seeed\"" "-DUSB_PRODUCT=\"Seeed XIAO M0\"" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS\\5.4.0/CMSIS/Core/Include/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS\\5.4.0/CMSIS/DSP/Include/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\tools\\CMSIS-Atmel\\1.2.1/CMSIS-Atmel/CMSIS/Device/ATMEL/" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\cores\\arduino" "-IF:\\MyPortable-PRgs\\arduino1.8.13\\portable\\packages\\Seeeduino\\hardware\\samd\\1.8.1\\variants\\XIAO_m0" "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_886788\\sketch\\Seeeduino-XIAO-Keyboard-Emulator-000-reduced.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for keyboard.h: []
Seeeduino-XIAO-Keyboard-Emulator-000-reduced:1:10: fatal error: keyboard.h: No such file or directory
ResolveLibrary(keyboard.h) #include "keyboard.h"
-> candidates: []~~~
compilation terminated.
exit status 1
keyboard.h: No such file or directory
So I thought simple thing do a google-search with the error-message
No results for Seeeduino XIAO
Then searched for Seeeduino XIAO USB-keyboard-emulation.
Just found a microPython-example. No C++-example
Now I'm stumped. I guess I need some basic understanding how the SAMD-Arm-M0-cortex-microcontroller work.
Or maybe I just have too much XIAOs peeking into my eyes that I can't see what has to be done to make it work.
I want the XIAO to act as an USB-keyboard which is connected to a PC
XIAO------>-----------PC-USB-Port
any hints are greatly appreciated
best regards Stefan