ユーザ用ツール

サイト用ツール


ja-jp_commands:display_rtc

文書の過去の版を表示しています。


表示装置とRTC

TM1637 4桁FND

IsegBegin()でCLK・DIOピンを設定してから、IsegBrightness()IsegDecimal()IsegHex()IsegWrite()IsegClear()を使用します。device番号で最大7台を区別します。

PCF8574キャラクタLCD

IclcdBegin(address, columns, rows)で開始してから、IclcdSetCursor()IclcdPrint()IclcdClear()IclcdBacklight()などを使用します。device番号で最大4台を区別します。

DS3231 RTC

コマンド 説明
IrtcBegin() RTC接続を確認して使用を開始します。
IrtcSet(…), IrtcRead(dateTime) 日付・時刻を設定または読み取ります。
IrtcUnixTime(unixTime) Unix時間を読み取ります。
IrtcGetTemperature(temperature) RTC内部温度を読み取ります。
IrtcSetAlarm1(…), IrtcSetAlarm2(…) アラームを設定します。
IrtcAlarmEnable(…), IrtcAlarmTriggered(…) アラームの有効状態と発生状態を管理します。
IrtcSquareWave(…), Irtc32kHz(…) 周波数出力を設定します。
void setup() {
  IsegBegin(22, 23);
  IsegDecimal(1234);
  IclcdBegin(0x27, 16, 2);
  IclcdPrint("ILOGICS");
  IrtcBegin();
}

TM1637コマンドのプロトタイプ

戻り型 コマンドのプロトタイプ
bool IsegBegin(uint8_t clkPin, uint8_t dioPin, uint16_t bitDelayUs = 100, uint8_t device = 0)
bool IsegBrightness(uint8_t brightness, bool on = true, uint8_t device = 0)
bool IsegClear(uint8_t device = 0)
bool IsegWrite(const uint8_t segments[], uint8_t length = 4, uint8_t position = 0, uint8_t device = 0)
bool IsegDecimal(int32_t number, bool leadingZero = false, uint8_t dotPosition = 0, uint8_t length = 4, uint8_t position = 0, uint8_t device = 0)
bool IsegHex(uint32_t number, bool leadingZero = false, uint8_t dotPosition = 0, uint8_t length = 4, uint8_t position = 0, uint8_t device = 0)
uint8_t IsegEncodeDigit(uint8_t digit)

キャラクタLCDコマンドのプロトタイプ

戻り型 コマンドのプロトタイプ
bool IclcdBegin(uint8_t address, uint8_t columns, uint8_t rows, bool backlight = true, uint8_t device = 0)
bool IclcdClear(uint8_t device = 0)
bool IclcdHome(uint8_t device = 0)
bool IclcdSetCursor(uint8_t column, uint8_t row, uint8_t device = 0)
bool IclcdDisplay(bool on = true, uint8_t device = 0)
bool IclcdCursor(bool on = true, uint8_t device = 0)
bool IclcdBlink(bool on = true, uint8_t device = 0)
bool IclcdBacklight(bool on = true, uint8_t device = 0)
bool IclcdScrollLeft(uint8_t device = 0)
bool IclcdScrollRight(uint8_t device = 0)
bool IclcdTextDirection(bool leftToRight = true, uint8_t device = 0)
bool IclcdAutoscroll(bool on = true, uint8_t device = 0)
bool IclcdCreateChar(uint8_t location, const uint8_t charmap[8], uint8_t device = 0)
bool IclcdWrite(uint8_t value, uint8_t device = 0)
bool IclcdCommand(uint8_t command, uint8_t device = 0)
bool IclcdPrint(const char value[], uint8_t device = 0)
bool IclcdPrint(const String& value, uint8_t device = 0)
bool IclcdPrint(const __FlashStringHelper* value, uint8_t device = 0)
bool IclcdPrint(char value, uint8_t device = 0)
bool IclcdPrint(unsigned char value, int base = DEC, uint8_t device = 0)
bool IclcdPrint(int value, int base = DEC, uint8_t device = 0)
bool IclcdPrint(unsigned int value, int base = DEC, uint8_t device = 0)
bool IclcdPrint(long value, int base = DEC, uint8_t device = 0)
bool IclcdPrint(unsigned long value, int base = DEC, uint8_t device = 0)
bool IclcdPrint(double value, int digits = 2, uint8_t device = 0)

RTCコマンドのプロトタイプ

戻り型 コマンドのプロトタイプ
bool IrtcBegin()
bool IrtcRead(IrtcDateTime& dateTime)
bool IrtcSet(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second)
bool IrtcSet(uint16_t year, uint8_t month, uint8_t day, uint8_t dayOfWeek, uint8_t hour, uint8_t minute, uint8_t second)
bool IrtcUnixTime(uint32_t& unixTime)
bool IrtcGetTemperature(float& temperature)
bool IrtcTimeValid(bool& valid)
bool IrtcClearOscillatorStopFlag()
bool IrtcSetAlarm1(uint8_t mode, uint8_t dayOrDate = 1, uint8_t hour = 0, uint8_t minute = 0, uint8_t second = 0)
bool IrtcSetAlarm2(uint8_t mode, uint8_t dayOrDate = 1, uint8_t hour = 0, uint8_t minute = 0)
bool IrtcAlarmEnable(uint8_t alarm, bool enable = true)
bool IrtcAlarmEnabled(uint8_t alarm, bool& enabled)
bool IrtcAlarmTriggered(uint8_t alarm, bool& triggered, bool clear = true)
bool IrtcSquareWave(bool enable, uint8_t frequency = IRTC_SQUARE_WAVE_1HZ, bool batteryPowered = false)
bool Irtc32kHz(bool enable = true)

各装置は該当するBeginコマンドを先に実行してください。I²Cアドレスとピンの共有有無を確認し、bool戻り値がfalseの場合は配線と電源を点検してください。

← 内蔵コマンド一覧

ja-jp_commands/display_rtc.1788785587.txt.gz · 最終更新: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki