Arduino ADK - CLion

Development for the Arduino ADK using CLion IDE

Author: Markus Rathgeb

Arduino Mega ADK Information


See: CLion, Language and framework-specific guidelines, PlatformIO

Workaround: Windows Business Certificate

Add your certificate chain to %HOME%\.platformio\pyenv\Lib\site-packages\certifi\cacert.pem


The following seems not be necessary, but need to be checked again: If necessary remove this “introduction”, if not necessary, remove the whole paragraph

CLion: Arduino Support Plugin


mkdir ~/bin/pkgs/arduino; tar xJf ~/Downloads/arduino-1.8.19-linux64.tar.xz -C ~/bin/pkgs/arduino

Create Project

Find Arduino SDK path

diff --git a/cmake/ArduinoToolchain.cmake b/cmake/ArduinoToolchain.cmake
index a2891ea..5f877ac 100644
--- a/cmake/ArduinoToolchain.cmake
+++ b/cmake/ArduinoToolchain.cmake
@@ -60,7 +60,8 @@ if (NOT ARDUINO_SDK_PATH)
     endforeach ()
     if (UNIX)
-        file(GLOB SDK_PATH_HINTS /usr/share/arduino*
+        file(GLOB SDK_PATH_HINTS $ENV{HOME}/bin/pkgs/arduino/arduino-*
+                /usr/share/arduino*

Enhance CMake min. Version

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 763b0f9..70225d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.23.0)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/ArduinoToolchain.cmake)
set(PROJECT_NAME adk_ac_02)
diff --git a/cmake/Platform/Arduino.cmake b/cmake/Platform/Arduino.cmake
index 6593d12..611d260 100644
--- a/cmake/Platform/Arduino.cmake
+++ b/cmake/Platform/Arduino.cmake
@@ -284,7 +284,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.23.0)

Run/Debug Configuration

Run configurations for e.g. upload should be created automatically.

Choose upload and build.


It seems “third party libraries” are used only if you import the library that name fits to the directory.



ADK 2012 Source

Sunday, March 3, 2013

Downloading the ADK 2012 Source

The Android Accessory Development Kit (ADK) for 2012 is the latest reference implementation of an Android Open Accessory device, designed to help Android hardware accessory builders and software developers create accessories for Android. The ADK 2012 is based on the Arduino open source electronics prototyping platform, with some hardware and software extensions that allow it to communicate with Android devices.

A limited number of these kits were produced and distributed at the Google I/O 2012 developer conference. If you did not receive one of these kits, fear not! The specifications and design files for the hardware were also released for use by manufacturers and hobbyists. You should expect to see kits with similar features available for purchase, or you can build one yourself!

Downloading the ADK Source on Ubuntu

The support software and hardware specifications for the ADK 2012 are available from the Android source repository. Follow the instructions below to obtain the source material for the ADK.

Before download the source, you have to install curl, git and repo. Refer here.

Then you can download the ADK 2012 Source, enter the commands in Terminal.

mkdir android-accessories
cd android-accessories
repo init -u
repo sync


After successfully completing this process, you should have the source code and tools for working with the ADK 2012:

Working Examples

Download UsbHost library with Android Open Accessory support. It can be taken from aoabook - Arduino in libraries/UsbHost.

There you will also find working examples.