-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
67 additions
and
6 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,29 @@ | ||
[env:esp32dev] | ||
platform = espressif32 | ||
board = esp32dev | ||
framework = arduino | ||
|
||
;##### Serial Port Settings ##### | ||
monitor_filters = esp32_exception_decoder, time | ||
monitor_speed = 115200 | ||
;monitor_port = COM4 | ||
|
||
;##### Upload-Port-Settings ##### | ||
upload_speed = 921600 | ||
;upload_port = COM4 | ||
|
||
;##### In-Circuit-Debug-Settings ##### | ||
debug_tool = esp-prog | ||
debug_init_break = tbreak setup | ||
|
||
;##### Build parameters ##### | ||
build_flags = | ||
;-DBOARD_HAS_PSRAM | ||
;-mfix-esp32-psram-cache-issue | ||
;-DCORE_DEBUG_LEVEL=5 | ||
|
||
;##### additional Libs ##### | ||
lib_deps = | ||
https://github.com/aanban/esp32_beo4 | ||
; | ||
|
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,38 @@ | ||
#include <Arduino.h> | ||
#include "IrBeo4.h" | ||
|
||
#define IR_RX_PIN 34 // IR receive pin | ||
IrBeo4 beo4(IR_RX_PIN); // instance | ||
|
||
// solution with task and queue | ||
// | ||
xQueueHandle beo4_rx_queue; // queue | ||
TaskHandle_t beo4_task_h; // task handle | ||
|
||
void beo4_task(void *parameter) { | ||
static uint32_t beo4Code=0; | ||
while(1) { | ||
if(pdTRUE==xQueueReceive(beo4_rx_queue,(void*)(&beo4Code),portMAX_DELAY)) { | ||
Serial.printf("beo4_task: %04x %s %s\n",beo4Code,beo_src_tbl(beo4Code),beo_cmd_tbl(beo4Code)); | ||
} | ||
} | ||
} | ||
|
||
|
||
// alternative solution with callback function | ||
// | ||
void beo_code_cb(uint32_t beo_code) { | ||
Serial.printf("beo_code_cb: %04x %s %s \n", beo_code,beo_src_tbl(beo_code),beo_cmd_tbl(beo_code)); | ||
} | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
beo4_rx_queue = xQueueCreate(50, sizeof(uint32_t)); | ||
xTaskCreatePinnedToCore(beo4_task,"beo4_task",10000,NULL,0,&beo4_task_h,0); | ||
beo4.Begin(beo4_rx_queue); | ||
printf("beo4 started, RX=%d\n",IR_RX_PIN); | ||
} | ||
|
||
void loop() { | ||
} | ||
|
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