Tutorial 4: Using the 4-digit display
Objectives: (i) Install external library for communication with the display, (ii) Implement nodes in XOD, (iii) Design numerical input and display, (iv) Implement external 4-digit display.
Requirements: Computer loaded with XOD and board driver, Rich UNO R3 board, 16x2 LCD display, 4-digit 7 segment display from the Biomaker Starter Kit, internet access to XOD libraries.
In order to drive the 4-digit 7-segment display on the Rich UNO R3, install the library cesars/tm1637. This supplies a number of nodes that can be used to control the display through the TM1637 support chip.
Node tm1637-dev accepts parameters for the clock and data pins, these are D10 and D11, respectively, for the onboard display.
Node bright-tm1637 can be connected to the above node and used to turn on, and regulate brightness of the display. The parameter “brightness” can be set to number from 0 (lowes brightness) to 7 (highest brightness). The parameter “on” is used to set the state of the display.
The library also provides several nodes for formatting the display. num-dec-tm1637 allows decimal display. The node num-decex-1637 allows display of numbers with decimal points, while num-hexex-1637 is used to display in hex format. The nodes accept parameters: “Number”, the value to be displayed; “Zeros”, For displays with dots between each digit: 1 = * 000.0, 2 = * 00.00, 3 = * 0.000, 4 = * 0.0.0.0 - and for displays with just a colon: 2 = * 00:00; “Length”, the number of digits to be displayed, and “Position”, the position from which to start the modification (0 - leftmost, 3 - rightmost)
The onboard display contains 4 digits, separated by a colon (ideal for display of time). The Starter Kit pack also contains an external device where the digits are separated by decimal points that can be activated as required. The external display can be easily wired to the board, using the expansion shield provided, and two suitable digital ports. It may be necessary to use the DIP switch to turn off the use of these ports, to avoid conflict with onboard devices. In the patch provided in the training library, the onboard potentiometer was used to provide a variable signal that can be used for input numbers.
Datasheet for TM1637:
CMOS chip to support (8 segment*6 bit common anode LED) display. Keyboard scan (8×2bit), Luminance adjustment circuit, two-wire serial interface (CLK, DIO), built-in RC oscillator, built-in power-on reset circuit, automatic blanking circuit.
Hook up 4-digit display to the onboard ereal time clock (RTC), and use for timer, clock or stopwatch display.
Use to display parameter values for other devices, such as onboard LM75 digital thermometer, or other devices contained in the Starter Kit.