You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## How to include an Arduino library into an existing project
19
19
20
-
First find the library from the list [here](arduino-libraries.md). Take note of the ID and the cmake target name.
20
+
First find the library from the list [here](docs/README.md). Take note of the ID and the cmake target name.
21
21
22
22
Get the submodule for the library and dependent libraries
23
23
````
@@ -63,30 +63,41 @@ The table below shows how the Arduino global variables such as SPI, Wire, Serial
63
63
64
64
## Compatibility
65
65
66
-
Arduino libraries that use direct register access or interrupts will not work.
66
+
Arduino libraries that rely on architecture specific code such as direct register access will not work.
67
67
68
68
## Directory structure
69
69
70
70
The directory structure of this repository is as follows:
71
71
arduino-compat: The compatibility layer
72
72
libs: The Arduino libraries and associated CMakeLists.txt files and examples
73
-
official-libs: Selected libraries from the official Arduino libraries repository
74
73
pico-libs: The C/C++ wrappers for the Arduino libraries
75
74
76
75
## FAQ
77
76
78
77
### How is pico-arduino-compat different from the Arduino RP2040 mbed core or the Arduino-Pico core?
79
-
These cores allow you to use the Arduino IDE to program the Pico/RP2040. pico-arduino-compat is for using Arduino libraries with the Pico C/C++ SDK.
78
+
Those cores allow you to use the Arduino IDE to program the Pico/RP2040. pico-arduino-compat is for using Arduino libraries with the Pico C/C++ SDK.
80
79
81
80
### Can Arduino sketches be used with pico-arduino-compat?
82
-
If the sketch uses functions and libraries implemented by pico-arduino-compat then it should run with a little modification. Most of the examples under arduino-libs are just modified Arduino sketches.
81
+
If the sketch doesn't use architecture specific code then then it should run with a little modification. eg. See libs/liquidcrystal/pico-sdk-examples
83
82
84
83
### Do applications using pico-arduino-compat run slower or use more resources?
85
-
Probably!
84
+
Probably! You're better off using a library specifically written for the Pico C/C++ SDK. However if nothing is available and you just want to get something working quickly then pico-arduino-compat might be useful.
86
85
87
86
### Do Arduino Libraries need to be modified to work with pico-arduino-compat?
88
87
Some don't. Some probably do. Some probably wont work at all.
89
88
89
+
### If the library list shows an error status does that mean the library can't be used with the Pico C/C++ SDK?
90
+
Not necessarily. The fix might be as simple as adding a dependency in the CMakeList.txt file. If it is, let me know!
91
+
92
+
### If the library list shows an OK status does that mean the library has been tested?
93
+
No. It just means that the source files compiled. Only a small number of the libraries have been tested on a device.
94
+
95
+
### How did you choose which Arduino libraries to include?
96
+
The libraries are those listed in the [Arduino reference documentation](https://www.arduino.cc/reference/en/libraries/). I simply scraped the relevant web pages to get the required information and generated the CMakeList.txt files from that.
97
+
98
+
### Can I only use a library if it is in the 'list of libraries'?
99
+
No. To use a different library, just add the arduino-compat directory and arduino-compat target to your CMakeLists.txt file. No guarantees it will work tho'!
100
+
90
101
## Acknowledgments
91
102
Much of the code uses earlephilhower's Pi Pico Arduino core.
0 commit comments