Skip to content

Commit 2173fbb

Browse files
author
fhdm-dev
committed
initial commit
1 parent fad5177 commit 2173fbb

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ A compatibility layer that allows the use of Arduino libraries with the Pico C/C
33

44
## Installation
55

6-
Clone pico-arduino-compat into somewhere convenient. Here we'll use /home/fhdm-dev/pico
6+
Clone the pico-arduino-compat repository
77

88
````
9-
cd /home/fhdm-dev/pico
109
git clone https://github.com/fhdm-dev/pico-arduino-compat.git
1110
````
1211

@@ -18,9 +17,14 @@ git submodule update --init arduino-compat/arduino-pico
1817

1918
## How to include an Arduino library into an existing project
2019

20+
First find the library from the list [here](arduino-libraries.md). Take note of the ID and the cmake target name.
21+
2122
Get the submodule for the library and dependent libraries
22-
eg. if we're including the adafruit-ssd1306 library
2323
````
24+
25+
# cd into libs/<id>
26+
# where id is the library ID you found previously
27+
# eg.
2428
cd libs/adafruit-ssd1306
2529
./init.sh
2630
````
@@ -32,11 +36,13 @@ eg.
3236
add_subdirectory(/home/fhdm-dev/pico/pico-arduino-compat/libs/adafruit-ssd1306)
3337
````
3438

39+
Add the library target name to target_link_libraries. Note that the target names all begin with 'pac-'
40+
3541
eg.
3642
````
3743
target_link_libraries(boom
3844
pico_stdlib
39-
adafruit-ssd1306
45+
pac-adafruit-ssd1306
4046
)
4147
````
4248

arduino-compat/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ target_include_directories(arduino-compat INTERFACE
5151
${CMAKE_CURRENT_LIST_DIR}/arduino-pico/cores/rp2040/
5252
${CMAKE_CURRENT_LIST_DIR}/arduino-pico/libraries/Wire/src/
5353
${CMAKE_CURRENT_LIST_DIR}/arduino-pico/libraries/SPI/
54+
${CMAKE_CURRENT_LIST_DIR}/arduino-pico/cores/rp2040/api/deprecated
5455
${CMAKE_CURRENT_LIST_DIR}/arduino-pico/cores/rp2040/api/deprecated-avr-comp
5556
)
5657

arduino-libraries.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Library|ID|CMake Target|Arch|Status|
2+
-------|--|------------|----|------|
3+
ACS-M1128|acs-m1128|pac-acs-m1128|all|make failed|
4+
AIStarter|aistarter|pac-aistarter|all|make failed|
5+
AS5047P|as5047p|pac-as5047p|all|cmake internal error|
6+
AUnit|aunit|pac-aunit|all|cmake internal error|
7+
Arduino Cloud Provider Examples|arduino-cloud-provider-examples|pac-arduino-cloud-provider-examples|samd|OK|
8+
Arduino_MKRTHERM|arduino_mkrtherm|pac-arduino_mkrtherm|samd|Cannot find repo url|
9+
BPLib|bplib|pac-bplib|all|OK|
10+
EMUSerial|emuserial|pac-emuserial|all|OK|
11+
FanController|fancontroller|pac-fancontroller|all|cmake internal error|
12+
FeatherFault|featherfault|pac-featherfault|samd|cmake internal error|
13+
FirmataWithDeviceFeature|firmatawithdevicefeature|pac-firmatawithdevicefeature|all|cmake internal error|
14+
MPR121|mpr121|pac-mpr121|all|cmake internal error|
15+
Octofet|octofet|pac-octofet|all|cmake internal error|
16+
Printoo_Library|printoo_library|pac-printoo_library|avr|cmake internal error|
17+
ProtoCentral ADS1292R ECG and Respiration boards library|protocentral-ads1292r-ecg-and-respiration-boards-library|pac-protocentral-ads1292r-ecg-and-respiration-boards-library|all|cmake internal error|
18+
STEAMbot|steambot|pac-steambot|arm, STM32F1|cmake internal error|
19+
STM32duino LSM6DSR|stm32duino-lsm6dsr|pac-stm32duino-lsm6dsr|stm32, avr, sam, samd|cmake internal error|
20+
STM32duino SPBTLE-RF|stm32duino-spbtle-rf|pac-stm32duino-spbtle-rf|stm32|make failed|
21+
SpeedMeasurer|speedmeasurer|pac-speedmeasurer|all|cmake internal error|
22+
WebServer_WT32_ETH01|webserver_wt32_eth01|pac-webserver_wt32_eth01|esp32|OK|

0 commit comments

Comments
 (0)