-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix espidf compatibility. using matrix in actions
- Loading branch information
Showing
10 changed files
with
193 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
name: Build esp32 | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
version: | ||
- esp32_V3_5_0 | ||
- esp32_V4_1_0 | ||
- esp32_V4_2_0 | ||
- esp32_V4_3_0 | ||
- esp32_V4_4_0 | ||
- esp32_V5_0_0 | ||
- esp32_V5_1_1 | ||
- esp32_V5_2_0 | ||
- esp32_V5_3_0 | ||
- esp32_V6_0_1 | ||
- esp32_V6_2_0 | ||
- esp32_V6_3_2 | ||
- esp32_V6_4_0 | ||
- esp32_V6_5_0 | ||
- esp32_V6_6_0 | ||
- esp32_V6_7_0 | ||
- esp32_V6_8_1 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Make directories | ||
run: bash extras/scripts/build-pio-dirs.sh | ||
- name: Build on PlatformIO | ||
run: bash extras/scripts/build-platformio.sh {{ matrix.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
name: Build examples for esp32 @ esp32_tasmota 2.0.15 | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Make directories | ||
run: bash extras/scripts/build-pio-dirs.sh | ||
- name: Build on PlatformIO | ||
run: bash extras/scripts/build-platformio.sh esp32_tasmota_2_0_15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#include "FastAccelStepper.h" | ||
|
||
// As in StepperDemo for Motor 1 on AVR | ||
//#define dirPinStepper 5 | ||
//#define enablePinStepper 6 | ||
//#define stepPinStepper 9 // OC1A in case of AVR | ||
|
||
// As in StepperDemo for Motor 1 on ESP32 | ||
#define dirPinStepper 18 | ||
#define enablePinStepper 26 | ||
#define stepPinStepper 17 | ||
|
||
FastAccelStepperEngine engine = FastAccelStepperEngine(); | ||
FastAccelStepper *stepper = NULL; | ||
|
||
|
||
void setup() { | ||
printf("START\n"); | ||
for (uint8_t i = 0;i < 10;i++) { | ||
printf("LOOP %d\n",i); | ||
vTaskDelay(pdMS_TO_TICKS(500)); | ||
esp_task_wdt_reset(); | ||
} | ||
|
||
engine.init(0); | ||
|
||
printf("Engine initialized\n"); | ||
for (uint8_t i = 0;i < 10;i++) { | ||
printf("LOOP %d\n",i); | ||
vTaskDelay(pdMS_TO_TICKS(500)); | ||
esp_task_wdt_reset(); | ||
} | ||
|
||
stepper = engine.stepperConnectToPin(stepPinStepper); | ||
|
||
printf("Stepper connected\n"); | ||
for (uint8_t i = 0;i < 10;i++) { | ||
printf("LOOP %d\n",i); | ||
vTaskDelay(pdMS_TO_TICKS(500)); | ||
esp_task_wdt_reset(); | ||
} | ||
|
||
if (stepper) { | ||
// stepper->setDirectionPin(dirPinStepper); | ||
// stepper->setEnablePin(enablePinStepper); | ||
// stepper->setAutoEnable(true); | ||
|
||
// If auto enable/disable need delays, just add (one or both): | ||
// stepper->setDelayToEnable(50); | ||
// stepper->setDelayToDisable(1000); | ||
|
||
stepper->setSpeedInUs(1000); // the parameter is us/step !!! | ||
stepper->setAcceleration(100); | ||
stepper->move(1000); | ||
printf("Stepper initialized\n"); | ||
} | ||
else { | ||
printf("No stepper\n"); | ||
} | ||
|
||
for (uint8_t i = 0;i < 10;i++) { | ||
printf("LOOP %d\n",i); | ||
vTaskDelay(pdMS_TO_TICKS(500)); | ||
esp_task_wdt_reset(); | ||
} | ||
} | ||
|
||
void loop() { | ||
while(stepper->isRunning()) { | ||
esp_task_wdt_reset(); | ||
printf("pos=%d\n", stepper->getCurrentPosition()); | ||
vTaskDelay(pdMS_TO_TICKS(500)); | ||
} | ||
stepper->move(1000); | ||
} | ||
|
||
extern "C" void app_main() | ||
{ | ||
setup(); | ||
while(true) { | ||
loop(); | ||
} | ||
// WARNING: if program reaches end of function app_main() the MCU will restart. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters