User Tools

Site Tools


en-us_commands:display_rtc

This is an old revision of the document!


Displays and RTC

TM1637 4-Digit FND

Set the CLK/DIO pins with IsegBegin(), then use IsegBrightness(), IsegDecimal(), IsegHex(), IsegWrite() and IsegClear(). The device number identifies up to 7 devices.

PCF8574 Character LCD

Start with IclcdBegin(address, columns, rows), then use IclcdSetCursor(), IclcdPrint(), IclcdClear(), IclcdBacklight(), etc. The device number identifies up to 4 devices.

DS3231 RTC

Command Description
IrtcBegin() Checks the RTC connection and starts using it.
IrtcSet(…), IrtcRead(dateTime) Sets or reads the date and time.
IrtcUnixTime(unixTime) Reads Unix time.
IrtcGetTemperature(temperature) Reads the internal RTC temperature.
IrtcSetAlarm1(…), IrtcSetAlarm2(…) Sets the alarm.
IrtcAlarmEnable(…), IrtcAlarmTriggered(…) Manages alarm enable and trigger status.
IrtcSquareWave(…), Irtc32kHz(…) Configures the frequency output.
void setup() {
  IsegBegin(22, 23);
  IsegDecimal(1234);
  IclcdBegin(0x27, 16, 2);
  IclcdPrint("ILOGICS");
  IrtcBegin();
}

TM1637 Command Prototypes

Return Type Command Prototype
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)

Character LCD Command Prototypes

Return Type Command Prototype
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 Command Prototypes

Return Type Command Prototype
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)

Run each device's corresponding Begin command first. Check I²C addresses and pin sharing; if the bool return value is false, inspect wiring and power.

← Built-in Command List

en-us_commands/display_rtc.1788785565.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki