Skip to content

Commit

Permalink
esp32 lib update (Untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blue-Crescent committed Jan 2, 2025
1 parent 56cf8d7 commit a78290b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
15 changes: 9 additions & 6 deletions examples/lcdclock_esp32/lcdclock_esp32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ void setup()
{

// 10msec Timer for clock ticktock (Mandatory)

timer = timerBegin(0, 80, true); // タイマー0, 分周比80(これにより1カウントが1マイクロ秒になる)
timerAttachInterrupt(timer, &ticktock, true); // 割り込み関数をアタッチ
timerAlarmWrite(timer, 10000, true); // 10ミリ秒のタイマー(10,000マイクロ秒)
timerAlarmEnable(timer); // タイマーを有効にする
attachInterrupt(digitalPinToInterrupt(DATA), isr_routine, CHANGE);
// 1. タイマー初期化
timer = timerBegin(100);

// 2. 割り込みルーチン( ISR )を紐付け
timerAttachInterrupt(timer, &ticktock);

// 3. タイマーを開始 ( = 割り込み有効化 )
timerStart(timer);



jjy.freq(40); // Carrier frequency setting. Default:40
Expand Down
12 changes: 8 additions & 4 deletions examples/sample_esp32/sample_esp32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ void setup() {
Serial.begin(115200);

// 10msec Timer for clock ticktock (Mandatory)
timer = timerBegin(0); // タイマー0, 分周比80(これにより1カウントが1マイクロ秒になる)
timerAttachInterrupt(timer, &ticktock); // 割り込み関数をアタッチ
timerWrite(timer, 10000); // 10ミリ秒のタイマー(10,000マイクロ秒)
timerStart(timer); // タイマーを有効にする
// 1. タイマー初期化
timer = timerBegin(100);

// 2. 割り込みルーチン( ISR )を紐付け
timerAttachInterrupt(timer, &ticktock);

// 3. タイマーを開始 ( = 割り込み有効化 )
timerStart(timer);

// DATA pin signal change edge detection. (Mandatory)
attachInterrupt(digitalPinToInterrupt(DATA), isr_routine, CHANGE);
Expand Down

0 comments on commit a78290b

Please sign in to comment.