mirror of
https://github.com/kakopappa/how-to-make-a-precompiled-arduino-library-for-esp8266-esp32.git
synced 2025-06-08 14:10:15 +03:00
Update ReadMe.md
This commit is contained in:
parent
f30d70cdaf
commit
128d4c1d36
12
ReadMe.md
12
ReadMe.md
@ -1,10 +1,10 @@
|
|||||||
Step 1:
|
**Step 1:**
|
||||||
|
|
||||||
Create hello.cpp and hello.h and add the implementation.
|
Create hello.cpp and hello.h and add the implementation.
|
||||||
|
|
||||||
Example files are in lib folder.
|
Example files are in lib folder.
|
||||||
|
|
||||||
Step 2:
|
**Step 2:**
|
||||||
|
|
||||||
Make the archive file (.a) using xtensa-esp32-elf-gcc.exe for ESP32 and use xtensa-lx106-elf-gcc for ESP8266
|
Make the archive file (.a) using xtensa-esp32-elf-gcc.exe for ESP32 and use xtensa-lx106-elf-gcc for ESP8266
|
||||||
|
|
||||||
@ -17,14 +17,16 @@ C:\Users\<USERNAME>\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32s2-
|
|||||||
|
|
||||||
Now you should have a libhello.a in the path.
|
Now you should have a libhello.a in the path.
|
||||||
|
|
||||||
Step 3:
|
**Step 3:**
|
||||||
|
|
||||||
1. Make the library for Ardunio (arduino-helloworld-lib) and copy the header files (lib\hello.h) to library src folder (arduino-helloworld-lib\src).
|
1. Make the library for Ardunio (arduino-helloworld-lib) and copy the header files (lib\hello.h) to library src folder (arduino-helloworld-lib\src).
|
||||||
2. Copy the libhello.a to arduino-helloworld-lib\src\esp32 or arduino-helloworld-lib\src\esp8266 depending on which gcc you use to create the archive file.
|
2. Copy the libhello.a to arduino-helloworld-lib\src\esp32 or arduino-helloworld-lib\src\esp8266 depending on which gcc you use to create the archive file.
|
||||||
|
|
||||||
Step 4:
|
**Step 4:**
|
||||||
|
|
||||||
Invoke the function from Ardunio sketch. example.ino
|
Invoke the function from Ardunio sketch. example.ino
|
||||||
|
|
||||||
|
``
|
||||||
#include <hello.h> // hello.h header from our library (arduino-helloworld-lib)
|
#include <hello.h> // hello.h header from our library (arduino-helloworld-lib)
|
||||||
|
|
||||||
#define BAUD_RATE 9600
|
#define BAUD_RATE 9600
|
||||||
@ -40,7 +42,7 @@ void loop() {
|
|||||||
Serial.println(result);
|
Serial.println(result);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
|
``
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user