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.
The board has a built-in clock and back-up battery. This is based on a DS1307 high-precision real-time clock module with I2C serial interface, and address of 68h. XOD provides direct support for this type of chip, and nodes and examples are provided for (i) setting the time, (ii) reading the time, and (iii) formating the year, month, day, date, hour, minute and second for processing or display.
An LM75 temperature sensor is mounted on the board next to the real time clock (RTC). The microcontroller communicates with it via an I2C interface, at the address 48h. The temperature sensor is internally calibrated and measures to ~0.1 degree C accuracy. The temperature is output as a number that can be operated on or displayed. The LM75a-temp-sensor node can be found in the gst/lm75atempsensor XOD library - and allows simple access to the on-board sensor. Numerical output from the lm75a-temp-sensor node can be reformatted using the format-number node. This allows the user to define the number of significant digits. The output of this node is in string format. This can be fed to a join node, which allows addition of defined text to the string, and this can be sent to the text-lcd-16x2-i2c node.
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.
In order to drive the 4-digit 7-segment display on the Rich UNO R3, install the library cesars/tm1637 from Cesar Sosa. 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. Download datasheet
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.