====== IsegDecimal() ====== ''IsegDecimal()'' displays an integer in decimal format. {{:en-us_commands:reference:isegdecimal.svg?900|IsegDecimal command operation flow}} ''bool IsegDecimal(int32_t number, bool leadingZero = false, uint8_t dotPosition = 0, uint8_t length = 4, uint8_t position = 0, uint8_t device = 0)'' ===== Commands ===== ^ Command ^ Arguments ^ Return Value ^ Operation ^ | ''IsegDecimal(number, leadingZero, dotPosition, length, position, device)'' | ''int32_t number'' — Decimal or hexadecimal value to display\\ ''bool leadingZero = false'' — ''true'': leading zeros, ''false'': leading spaces\\ ''uint8_t dotPosition = 0'' — Decimal point position. ''0'' means none; ''1~length'' selects the digit from the left\\ ''uint8_t length = 4'' — Number of digits to write ''1~4''\\ ''uint8_t position = 0'' — Start position ''0~3''; the leftmost digit is ''0''\\ ''uint8_t device = 0'' — FND device number ''0~6'', defaults to ''0'' | ''bool'' | Displays an integer in decimal format. | ===== Example ===== void setup() { IsegBegin(14, 15, 100, 0); // Set the CLK/DIO pins and device number of the TM1637 FND. IsegBegin(130, 131, 100, 1); // MPAINO K/K2 GPIO channels 0, 1 IsegBrightness(7, true, 0); // Set display brightness and on/off state. IsegBrightness(4, true, 1); // Set display brightness and on/off state. } void loop() { IsegDecimal(1234, false, 0, 4, 0, 0); // Display an integer in decimal format. IsegHex(0xABCD, false, 0, 4, 0, 1); // Display an integer in hexadecimal format. } ===== Precautions ===== * These commands are only for 4-digit FND displays with a TM1637 IC. They do not directly drive a generic multiplexed FND display. * Use display commands after successfully calling ''IsegBegin()''. * Initialization fails if CLK and DIO use the same pin, or if the device number is ''7'' or higher. * ''length + position'' must be 4 or less. Numbers outside the range are not displayed, and ''false'' is returned. * Communication may block execution for several ms. Do not call this from an interrupt service routine. * Do not use the specified pins simultaneously for UART, PWM, encoders, external interrupts or other functions. * Check the actual module and product manuals for FND power and signal voltages. ===== Built-in Commands in the Same Category ===== * [[:en-us_commands:reference:isegbegin|IsegBegin() View detailed description]] * [[:en-us_commands:reference:isegbrightness|IsegBrightness() View detailed description]] * [[:en-us_commands:reference:isegclear|IsegClear() View detailed description]] * [[:en-us_commands:reference:isegwrite|IsegWrite() View detailed description]] * [[:en-us_commands:reference:iseghex|IsegHex() View detailed description]] * [[:en-us_commands:reference:isegencodedigit|IsegEncodeDigit() View detailed description]] [[:en-us_commands:builtin|← Built-in Command List]]