Changes between Version 7 and Version 8 of PCF2129AT


Ignore:
Timestamp:
Nov 30, 2015 11:28:34 PM (8 years ago)
Author:
kishida
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PCF2129AT

    v7 v8  
    119119刻々と時間を刻みます。Arduinoは100msごとに時間を読みにっているので、表示される秒の値は多少遅れます。[[BR]]
    120120RTCは電源が供給される限り内部で時間を刻みます。
    121 
     121=== gettime.ino ===
    122122{{{
    123 /* 
     123/*
    124124 *  I2Cで接続したPCF2129ATに
    125125 *  日時を書き込んだ後に
    126  *  読みだすプログラム
     126 *  読みだすプログラム
     127 *  通信はI2Cです
     128 *  http://trac.switch-science.com/wiki/PCF2129AT
    127129 */
    128130#include <Wire.h>
     
    131133
    132134PCF2129AT rtc;
    133 dt_dat dt;
     135dt_dat dt,dt_alarm;
    134136void setup()
    135137{
     
    139141    Serial.println("PC2129AT Sample Program");
    140142    dt.y = 2015;                // 年の設定(2000年代)
    141     dt.wd = 0;                  // 曜日の設定(日曜=0〜土曜=6)
     143    dt.wd = 0;                  // 週の設定(0-6)
    142144    dt.mm = 11;                 // 月の設定(1-12)
    143145    dt.d = 16;                   // 日の設定(1-)
     
    146148    dt.s = 0;                   // 秒の設定
    147149    rtc.setDate(&dt);              // 日時の設定
     150    rtc.setAlarm(&dt_alarm);
    148151}
    149152
    150153void loop ()
    151154{
    152         rtc.getTime(&dt);          // 日時の取得
     155        rtc.getDate(&dt);          // 日時の取得
    153156        // 日時の表示
    154157        Serial.print("year :");
     
    168171        delay(100);
    169172}
     173
    170174}}}
    171175
    172 === 動作サンプル ===
     176==== 動作サンプル ====
    173177
    174178[[Image(sample1.png,480px)]]
     179
     180=== alarm.ino ===
     181
     182 アラーム機能のサンプルプログラムです。
     183
     184=== alarm_with_tft.ino ===
     185
     186 SWITCHSICENCEmagazineで公開(予定)の液晶に時間を表示するアラーム機能のサンプルです。
    175187
    176188== ライブラリ ==
     
    179191"libraries"ディレクトリ下に解凍して作成されるPCF2129ATフォルダを設置してください。
    180192
    181 現在のバージョンは2015/11/16版です。
    182 
    183 [attachment:PCF2129AT.zip]
     193現在のバージョンは2015/11/30版です。
     194
     195  === 更新履歴 ===
     196 
     197   11/16:時刻機能の追加
     198
     199   11/30:アラーム機能の追加
     200 
     201[attachment:PCF2129AT.2.zip]
    184202
    185203== 付録 ==
     204
    186205mbedのページ(CQ出版) [https://developer.mbed.org/teams/CQ_I2C_book/code/PCF2129AT/ https://developer.mbed.org/...]
     206
    187207mbedのページ(NXP) [https://developer.mbed.org/users/nxp_ip/code/PCF2127/ https://developer.mbed.org/...]