This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathmultiFileProject.ino
60 lines (45 loc) · 1.76 KB
/
multiFileProject.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/****************************************************************************************************************************
multiFileProject.ino
For ESP32, ESP32_S2, ESP32_S3, ESP32_C3 boards with ESP32 core v2.0.2+
Written by Khoi Hoang
Built by Khoi Hoang https://github.com/khoih-prog/ESP32TimerInterrupt
Licensed under MIT license
*****************************************************************************************************************************/
// To demo how to include files in multi-file Projects
#if !defined( ESP32 )
#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting.
#endif
#define ESP32_TIMER_INTERRUPT_VERSION_MIN_TARGET "ESP32TimerInterrupt v2.0.1"
#define ESP32_TIMER_INTERRUPT_VERSION_MIN 2000001
#include "multiFileProject.h"
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include "ESP32TimerInterrupt.h"
#include "ESP32_ISR_Timer.h"
void doingSomething1()
{
// Replace or comment out Serial.println() if crashed
Serial.println("doingSomething1 triggered");
}
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
while (!Serial);
delay(500);
Serial.println("\nStart multiFileProject");
Serial.println(ESP32_TIMER_INTERRUPT_VERSION);
#if defined(ESP32_TIMER_INTERRUPT_VERSION_MIN)
if (ESP32_TIMER_INTERRUPT_VERSION_INT < ESP32_TIMER_INTERRUPT_VERSION_MIN)
{
Serial.print("Warning. Must use this example on Version equal or later than : ");
Serial.println(ESP32_TIMER_INTERRUPT_VERSION_MIN_TARGET);
}
#endif
setupISR(); // in multifileProject.cpp
ISR_Timer.setTimeout(5000, doingSomething1);
}
void loop()
{
// put your main code here, to run repeatedly:
delay(1);
}