Download Print this page

AZ-Delivery 3642BH Instruction Manual

4 digits 7 segment display

Advertisement

Quick Links

Welcome!
Thank you for purchasing our AZ-Delivery 4 Digits 7 Segment Display. On
the following pages, we will introduce you to how to use and set-up this
handy device.
Have fun!

Advertisement

loading
Need help?

Need help?

Do you have a question about the 3642BH and is the answer not in the manual?

Questions and answers

Summary of Contents for AZ-Delivery 3642BH

  • Page 1 Welcome! Thank you for purchasing our AZ-Delivery 4 Digits 7 Segment Display. On the following pages, we will introduce you to how to use and set-up this handy device. Have fun!
  • Page 2 Areas of application Education and teaching: Use in schools, universities and training institutions to teach the basics of electronics, programming and embedded systems. Research and development: Use in research and development projects to create prototypes and experiments in the fields of electronics and computer science. Prototype development: Use in the development and testing of new electronic circuits and devices.
  • Page 3 Use an anti-static cleaning cloth or special electronics cleaner to carefully clean the display. Although the display complies with the requirements of the RoHS Directive (2011/65/EU) and does not contain any hazardous substances in quantities above the permitted limits, residual chemical hazards may still exist. Please note the following safety instructions: Attention: The back of the display and the circuit board can release chemical residues from manufacturing or during operation.
  • Page 4: Specifications

    The seven segment display contains seven individually addressable LEDs packed in one package, labeled from A to G. In the 7 segment 4 digit display there are four seven segment displays, thus we are able to show 4 digits with this module. Thеsе kind of modules usually require 12 digital pins in order to control it, but the module we write about in this eBook has just four.
  • Page 5 Connecting the module with Atmega328P Board Module pin > Board pin > GND Black wire > 5V Red wire > D3 Green wire > D2 Blue wire...
  • Page 6 Arduino IDE library In order to use the module with the microcontroller board, it is best if we download a library for it. Open the Arduino IDE and go to Tools > Manage Libraries, and a new window will open. Type "TM1637" in the search box and install a library "TM1637"...
  • Page 7 Sketch code: #include <Arduino.h> #include <TM1637Display.h> #define #define #define TEST_DELAY 2000 // delay in miliseconds const uint8_t SEG_DONE[] = { SEG_B SEG_C SEG_D SEG_E | SEG_G, // d SEG_A SEG_B SEG_C SEG_D SEG_E | SEG_F, // O SEG_C SEG_E | SEG_G, // n SEG_A SEG_D...
  • Page 8 void turnON_segment() { // Selectively set different digits data[0] = display.encodeDigit(0); data[1] = display.encodeDigit(1); data[2] = display.encodeDigit(2); data[3] = display.encodeDigit(3); display.setSegments(data); delay(TEST_DELAY); display.clear(); display.setSegments(data+2, 2, 2); delay(TEST_DELAY); display.clear(); display.setSegments(data+2, 2, 1); delay(TEST_DELAY); display.clear(); display.setSegments(data+1, 3, 1); delay(TEST_DELAY); void display_numbers() { // How to show decimal numbers in many ways display.showNumberDec(0, false);...
  • Page 9 display.showNumberDec(301, true); // Expect: 0301 // one tab delay(TEST_DELAY); display.clear(); display.showNumberDec(14, false, 2, 1); // Expect: _14_ delay(TEST_DELAY); display.clear(); display.showNumberDec(4, true, 2, 2); // Expect: __04 delay(TEST_DELAY); display.showNumberDec(-1, false); // Expect: __-1 delay(TEST_DELAY); display.showNumberDec(-12); // Expect: _-12 delay(TEST_DELAY); display.showNumberDec(-999); // Expect: -999 delay(TEST_DELAY);...
  • Page 10 void turn_dots() { for(int k = 0; k <= 4; k++) { display.showNumberDecEx(0, (0x80 >> k), true); delay(TEST_DELAY); void brightness_test() { for(int k = 0; k < 4; k++) { data[k] = 0xff; for(int k = 0; k < 7; k++) { display.setBrightness(k);...
  • Page 11 At the beginning of the sketch two macros are created, called CLK and DIO. These macros represent digital pin names of the Atmega328P Board that are used to connect the module with microcontroller board. After that, another macro is created, called TEST_DELAY; it is a time interval between two display functions and it is initialized on 2000 milliseconds, or 2 seconds.
  • Page 12 In the loop() function we call all other functions that we created in the sketch, and wait for 5 seconds between each loop of the loop() function. First function that used function loop() turnON_allSegments(), and it does what its name says, it is used to turn ON all the segments of the module, and then wait for 2 seconds (TEST_DELAY macro value).
  • Page 13 The turn_dots() function is used to turn two LEDs between second and third segment of seven segment the module. The brightness_test() function is used to show all brightness levels that can be used for this module. The ON_OFF_test() function is used to show you another method of how to turn ON or OFF all segments of the module.
  • Page 14 Connecting the module with Raspberry Pi Module pin > Raspberry Pi pin > 3V3 [pin 1] Red wire > GND [pin 9] Black wire > GPIO17 [pin 11] Blue wire > GPIO27 [pin 13] Green wire...
  • Page 15 Python library In order to use the module with the Raspberry Pi, it is recommended to download a library. We will use the library called “raspberrypi-python- tm1637”. To download and install this library, we need to have installed wiringPi and GIT app. These tools come preinstalled with the Raspbian operating system, but if you do not have them installed, here is how to do it.
  • Page 16 Python script: import tm1637 from time import sleep tm1637.TM1637(clk=27, dio=17) show(): tm.write([127, 255, 127, 127]) # all LEDS on "88:88" sleep(1) tm.write([0, 0, 0, 0]) # all LEDS off sleep(1) tm.write([63, 6, 91, 79]) # show "0123" sleep(1) tm.write([0b00111001, 0b00111111, 0b00111111, 0b00111000]) # "COOL"...
  • Page 17 finally: tm.write([0, 0, 0, 0]) Save this code to a script, called “sevenSegment.py”, and make sure the script is saved in the “raspberrypi-python-tm1637” directory. To run the script, open terminal in that directory, and run the following command: python3 sevenSegment.py NOTE: Script code is self explanatory.
  • Page 18 If you are looking for the high quality microelectronics and accessories, AZ-Delivery Vertriebs GmbH is the right company to get them from. You will be provided with numerous application examples, full installation guides, eBooks, libraries and assistance from our technical experts.