Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Esp lib3.0.7への更新 #13

Merged
merged 5 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions examples/lcdclock_esp32/lcdclock_esp32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
#define PON 33
#define SEL 25


hw_timer_t * timer = NULL;

JJYReceiver jjy(DATA,SEL,PON); // JJYReceiver lib set up.
LiquidCrystal lcd = LiquidCrystal(16,17,4,0,2,15); // RS, Enable, D4, D5, D6, D7

void IRAM_ATTR ticktock() {
void ARDUINO_ISR_ATTR ticktock() {
jjy.delta_tick();
}

Expand All @@ -23,16 +24,23 @@ 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);

// タイマーの初期化
timer = timerBegin(1000000); // タイマー周波数を1MHzに設定

// Attach ticktock function to our timer.
timerAttachInterrupt(timer, &ticktock);

jjy.freq(40); // Carrier frequency setting. Default:40
// Set alarm to call onTimer function every 10 milliseconds (value in microseconds).
// Repeat the alarm (third parameter) with unlimited count = 0 (fourth parameter).
timerAlarm(timer, 10000, true, 0); // 10ミリ秒ごとの割り込み設定

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

jjy.freq(60); // Carrier frequency setting. Default:40
jjy.begin(); // Start JJY Receive

lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0,0);
Expand Down
10 changes: 5 additions & 5 deletions examples/sample_esp32/sample_esp32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ JJYReceiver jjy(DATA,SEL,PON); // JJYReceiver lib set up.

hw_timer_t * timer = NULL;

void IRAM_ATTR ticktock() {
void ARDUINO_ISR_ATTR ticktock() {
jjy.delta_tick();
}

Expand All @@ -22,10 +22,10 @@ void setup() {
Serial.begin(115200);

// 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); // タイマーを有効にする
timer = timerBegin(1000000); // タイマー周波数を1MHzに設定
timerAttachInterrupt(timer, &ticktock);
timerAlarm(timer, 10000, true, 0); // 10ミリ秒ごとの割り込み設定


// DATA pin signal change edge detection. (Mandatory)
attachInterrupt(digitalPinToInterrupt(DATA), isr_routine, CHANGE);
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=JJYReceiver
version=0.8.6
version=0.8.7
author=BlueCrescent
maintainer=BlueCrescent <[email protected]>
sentence=JJY standard radio signal wave receiver library.
Expand Down
Loading