LoginSignup
0
1

More than 5 years have passed since last update.

esp8266 で ds3231を使う4 定期処理

Last updated at Posted at 2017-04-29

概要

ds3231 にあるsqwピン(方形派?)を使って定期処理をさせたいと思います。
思うところまでは到達していませんが、忘れないうちに覚書です。

接続

モノ:esp8266 DS3231 LED

DS3231にある、sqwピンをGPIO13ピンにつなぎました。
LEDはGPIO15ピンにつなぎました。

#コード
下のコードを参考に書き換え



void loop()
{
   clock.enableOutput(state);
   state = !state;
   delay(1000);

     if (digitalRead(13) == HIGH) {     //インプットの状態を確認
          digitalWrite(15,HIGH) ;      //出力れているならLEDを点灯
          Serial.println("tentou");
     } else {
          digitalWrite(15,LOW) ;       //出力されていないならLEDを消灯
          Serial.println("shoutou");
     }

}

#データシート
https://datasheets.maximintegrated.com/en/ds/DS3231.pdf
http://www.ne.jp/asahi/o-family/extdisk/DS3234RTC/DS3234RTCm_jp.pdf

なんとなく、アラーム設定したら、信号だしてくれのかな?

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1