8-Digit 7 Segment Module (MAX7219) [D066]




https://www.youtube.com/watch?v=m5Ej3hZ2OkI


* GitHub : https://github.com/rdiot/rdiot-d066.git


* Specs

Features:

100% Brand new and high quality

MAX7219 digital display control module

This module is compatible with 5V and 3.3V microcontrollers.

You you can use it for Arduino

MAX7219 is an integrated serial input / output common-cathode display driver, which connects your microprocessor to a 7-segment digital LED display with 8 digits.

Only three IO ports are used to drive the eight digit display. MAX7219 supports flicker free displays as well as cascading displays.


Specifications:

Material: PCB + Electronic Components

Power: 5V

Size: 82*15*12mm(L*W*H)

Shell Color: Blue & black

Net Weight:13g


Package includes:

1* MAX7219 digital display module

1* Straight 5 pin header

1* 90 degree 5 pin header


Wiring instructions(for example, it can connect any IO port, modified the Port Definition in the program):

VCC: 5V

GND: GND

DIN: P00

CS: P01

CLK: P02



* Contents

- Connect

DIN........D11

CS (LOAD)..D10

CLK........D13


- Library : https://github.com/HobbyComponents/HCMAX7219


- Key Code (Tested Example)

/* FILE:    HCMODU0082_Serial_7_Segment_Module_Example1

   DATE:    19/03/15

   VERSION: 0.2

  

REVISIONS:

12/03/15 Created version 0.1

19/03/15 Updated to work with V0.2 of the HCMAX7219 library

This is an example of how to use the Hobby Components serial 8 digit seven 7 

segment display module (HCMODU0082). To use this example sketch you will 

need to download and install the HCMAX7921 library available from the software

section of our support forum (forum.hobbycomponents.com) or on github:

(https://github.com/HobbyComponents)


The library assumes you are using one module. If you have more than one module

connected together then you will need to change the following line in the 

libraries HCMAX7219.h header file to the number of drivers you have connected:


#define NUMBEROFDRIVERS 1 <- Change this number


PINOUT:

MODULE.....UNO/NANO.....MEGA

VCC........+5V..........+5V

GND........GND..........GND

DIN........11...........51

CS (LOAD)..10...........10

CLK........13...........52


You may copy, alter and reuse this code in any way you like, but please leave

reference to HobbyComponents.com in your comments if you redistribute this code.

This software may not be used directly for the purpose of promoting products that

directly compete with Hobby Components Ltd's own range of products.


THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, 

WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED 

WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR

LACK OF NEGLIGENCE. HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE

FOR ANY DAMAGES INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR 

CONSEQUENTIAL DAMAGES FOR ANY REASON WHATSOEVER. */


/* Include the HCMAX7219 and SPI library */

#include <HCMAX7219.h>

#include "SPI.h"


/* Set the LOAD (CS) digital pin number*/

#define LOAD 10


/* Create an instance of the library */

HCMAX7219 HCMAX7219(LOAD);


/* Main program */

void loop() 

{

  /* Clear the output buffer */

  HCMAX7219.Clear();


  /* Write some text to the output buffer */

  HCMAX7219.print7Seg("HELLO !!",8);


  /* Send the output buffer to the display */

  HCMAX7219.Refresh();  


  delay(2000);


  /* Clear the output buffer */

  HCMAX7219.Clear();


  /* Write some text to the output buffer */

  HCMAX7219.print7Seg("D066",8);


  /* Send the output buffer to the display */

  HCMAX7219.Refresh();  


  delay(2000);


  /* Clear the output buffer */

  HCMAX7219.Clear();


  /* Write some text to the output buffer */

  HCMAX7219.print7Seg("8-Digit",8);


  /* Send the output buffer to the display */

  HCMAX7219.Refresh();  


  delay(2000);


  /* Clear the output buffer */

  HCMAX7219.Clear();


  /* Write some text to the output buffer */

  HCMAX7219.print7Seg("MAX7219",8);


  /* Send the output buffer to the display */

  HCMAX7219.Refresh();  


  delay(2000);


  HCMAX7219.Clear();

  for (int Position = 1; Position <= 7; Position++)

  { 

    HCMAX7219.print7Seg(-1234567,Position,8);

    HCMAX7219.Refresh();

    delay(1000);

  }



  /* Clear the output buffer */

  HCMAX7219.Clear();


  /* Write some text to the output buffer */

  HCMAX7219.print7Seg("BYE",8);


  /* Send the output buffer to the display */

  HCMAX7219.Refresh();  


  delay(2000);


  while(1);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

4 Digit Tube LED Display Module (TM1637) [D014]



https://www.youtube.com/watch?v=ElOG2A8QVPw


* GitHubhttps://github.com/rdiot/rdiot-d014.git


* Specs

The module is a 12-foot clock with 4 points of positive digital (0.36 inches) display module driver IC TM1637, only two signal lines can make SCM four 8-segment LED.


Module features are as follows:

Display of male red for the four digital tube

Adjustable digital tube 8 gray

Level control interface for 5V or 3.3V

4 M2 screws positioning holes for easy installation


4 digital display interface module as shown below:

Control Interface: A total of four pins (GND, VCC, DIO, CLK), GND to ground, VCC is the power supply, DIO of data input and output pin, CLK is the clock signal pin;

Digital tube: 4 common anode score points with 0.36 inches LED, red highlights;

Positioning holes: 4 M2 screws positioning hole diameter is 2.2mm, the positioning of the module is easy to install, to achieve inter-module combination.



* Contents

- DataSheet : http://www.datasheet-pdf.com/pdfhtm.php?id=788613&p=10


- Connect

CLK ----- D2

DIO ----- D3

VCC ----- 5V

GND ----- GND


- Library : https://github.com/avishorp/TM1637


- Key Code : Example TM1637Test.ino

#include <Arduino.h>

#include <TM1637Display.h>


// Module connection pins (Digital Pins)

#define CLK 2

#define DIO 3


// The amount of time (in milliseconds) between tests

#define TEST_DELAY   2000


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 SEG_E SEG_F SEG_G            // E

 };


TM1637Display display(CLK, DIO);


void loop()

{

  int k;

  uint8_t data[] = { 0xff, 0xff, 0xff, 0xff };

  display.setBrightness(0x0f);


  // All segments on

  display.setSegments(data);

  delay(TEST_DELAY);


  // Selectively set different digits

  data[0] = 0b01001001;

  data[1] = display.encodeDigit(1);

  data[2] = display.encodeDigit(2);

  data[3] = display.encodeDigit(3);


  for(k = 3; k >= 0; k--) {

    display.setSegments(data, 1, k);

    delay(TEST_DELAY);

  }


  display.setSegments(data+2, 2, 2);

  delay(TEST_DELAY);


  display.setSegments(data+2, 2, 1);

  delay(TEST_DELAY);


  display.setSegments(data+1, 3, 1);

  delay(TEST_DELAY);



  // Show decimal numbers with/without leading zeros

  bool lz = false;

  for (uint8_t z = 0; z < 2; z++) {

   for(k = 0; k < 10000; k += k*4 + 7) {

   display.showNumberDec(k, lz);

   delay(TEST_DELAY);

   }

  lz = true;

  }


  // Show decimal number whose length is smaller than 4

  for(k = 0; k < 4; k++)

   data[k] = 0;

   display.setSegments(data);


   display.showNumberDec(153, false, 3, 1);

   delay(TEST_DELAY);

   display.showNumberDec(22, false, 2, 2);

   delay(TEST_DELAY);

   display.showNumberDec(0, true, 1, 3);

   delay(TEST_DELAY);

   display.showNumberDec(0, true, 1, 2);

   delay(TEST_DELAY);

   display.showNumberDec(0, true, 1, 1);

   delay(TEST_DELAY);

   display.showNumberDec(0, true, 1, 0);

   delay(TEST_DELAY);



  // Brightness Test

  for(k = 0; k < 4; k++)

    data[k] = 0xff;

    for(k = 0; k < 16; k++) {

      display.setBrightness(k);

      display.setSegments(data);

      delay(TEST_DELAY);

    }

  // Done!

  display.setSegments(SEG_DONE);

  while(1);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요

7Segment 4 Digit LED Module (5461AS) [D013]



https://www.youtube.com/watch?v=tf46Nr7TnTU


*GitHub : https://github.com/rdiot/rdiot-d013.git


* Contents

- DataSheet : http://deneb21.tistory.com/attachment/cfile24.uf@247A634855D713A025946C.pdf


- Connect

http://thomas.bibby.ie/wp-content/uploads/2015/10/KYX-5461AS-300x194.jpg


- Connect LM35

VCC - 5V

Output - A0

GND - GND


- Key Code

int sensorPin = 0;


//display pins

int segA = 5;

int segB = 13;

int segC = 10;

int segD = 8;

int segE = 7;

int segF = 4;

int segG = 11;

int segPt = 9;


int d1 = 6;

int d2 = 3;

int d3 = 2;

int d4 = 12;


int delayTime = 900;


int counter = 0;


float temperature = 77.7;


//only read temp every 100 cycles

if(counter%500 == 0)

{

  // read the pin

  int reading = analogRead(sensorPin);

  

  //convert reading to volts

  float volts = (reading * 5.0);

  volts /= 1024.0;


  temperature = volts * 100.0;


 counter = 0;

}


counter ++;


selectDigit(1);

sendDigit(tens(temperature));

delayMicroseconds(delayTime);


...

Posted by RD IoT RDIoT

댓글을 달아 주세요

7Segment 1 Digit LED Module (5161AS) [D011]



https://www.youtube.com/watch?v=S7d2ge_iANI


* GitHubhttps://github.com/rdiot/rdiot-d011.git


* Specs

Emitting color : Red

Encapsulation Adhesive Color : Red

Surface Color of the Shell : Black

Voltage : 1.8~1.9V

Luminous Intensity : 13~15 mcd

Wavelengh : 648 nm


* Contents

- DataSheet : http://www.dipmicro.com/?datasheet=TOS-5161AS.pdf


- Connect

1 - X

2 - D2  (LedC)

3 - R220 -> GND

4 - D3  (ledD)

5 - D4  (ledE)

6 - D5  (ledG)

7 - D6  (LedF)

8 - R220 -> GND

9 - D8   (LedA)

10- D9  (LedB)


- Key Code

#define ledA 8

#define ledB 9

#define ledC 2

#define ledD 3

#define ledE 4

#define ledF 6

#define ledG 5

 

void setup()

{

  pinMode(ledA, OUTPUT);

  pinMode(ledB, OUTPUT);

  pinMode(ledC, OUTPUT);

  pinMode(ledD, OUTPUT);

  pinMode(ledE, OUTPUT);

  pinMode(ledF, OUTPUT);

  pinMode(ledG, OUTPUT);

  Serial.begin(9600);

}

 

void loop()

{

  Serial.println("Starting\n");

  LoopDisplay();    //Call LoopDisplay Function

}

 

void clr()

{

  //Clears the LED

  digitalWrite(ledA, LOW);

  digitalWrite(ledB, LOW);

  digitalWrite(ledC, LOW);

  digitalWrite(ledD, LOW);

  digitalWrite(ledE, LOW);

  digitalWrite(ledF, LOW);

  digitalWrite(ledG, LOW);

}

 

 

void char_A()

{

  digitalWrite(ledD, LOW);

  digitalWrite(ledE, HIGH);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, HIGH);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, HIGH);

  digitalWrite(ledC, HIGH);

}

 

void char_B()

{

  //Displays B

  digitalWrite(ledD, HIGH);

  digitalWrite(ledE, HIGH);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, HIGH);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, HIGH);

  digitalWrite(ledC, HIGH);

}

 

void char_C()

{

  //Displays C

  digitalWrite(ledD, HIGH);

  digitalWrite(ledE, HIGH);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, LOW);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, LOW);

  digitalWrite(ledC, LOW);

}

 

void char_D()

{

  //Displays D

  digitalWrite(ledD, HIGH);

  digitalWrite(ledE, HIGH);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, LOW);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, HIGH);

  digitalWrite(ledC, HIGH);

}

 

void char_E()

{

  //Displays E

  digitalWrite(ledD, HIGH);

  digitalWrite(ledE, HIGH);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, HIGH);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, LOW);

  digitalWrite(ledC, LOW);

}

 

void char_F()

{

  //Displays F

  digitalWrite(ledD, LOW);

  digitalWrite(ledE, HIGH);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, HIGH);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, LOW);

  digitalWrite(ledC, LOW);

}

 

 

void one()

{

  //Displays 1

  digitalWrite(ledD, LOW);

  digitalWrite(ledE, LOW);

  digitalWrite(ledF, LOW);

  digitalWrite(ledG, LOW);

  digitalWrite(ledA, LOW);

  digitalWrite(ledB, HIGH);

  digitalWrite(ledC, HIGH);

}

 

void two()

{

  //Displays 2

  digitalWrite(ledD, HIGH);

  digitalWrite(ledE, HIGH);

  digitalWrite(ledF, LOW);

  digitalWrite(ledG, HIGH);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, HIGH);

  digitalWrite(ledC, LOW);

}

 

void three()

{

  //Displays 3

  digitalWrite(ledD, HIGH);

  digitalWrite(ledE, LOW);

  digitalWrite(ledF, LOW);

  digitalWrite(ledG, HIGH);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, HIGH);

  digitalWrite(ledC, HIGH);

}

 

void four()

{

  //Displays 4

  digitalWrite(ledD, LOW);

  digitalWrite(ledE, LOW);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, HIGH);

  digitalWrite(ledA, LOW);

  digitalWrite(ledB, HIGH);

  digitalWrite(ledC, HIGH);

}

 

void five()

{

  //Displays 5

  digitalWrite(ledD, HIGH);

  digitalWrite(ledE, LOW);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, HIGH);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, LOW);

  digitalWrite(ledC, HIGH);

}

 

void six()

{

  //Displays 6

  digitalWrite(ledD, HIGH);

  digitalWrite(ledE, HIGH);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, HIGH);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, LOW);

  digitalWrite(ledC, HIGH);

}

 

void seven()

{

  //Displays 7

  digitalWrite(ledD, LOW);

  digitalWrite(ledE, LOW);

  digitalWrite(ledF, LOW);

  digitalWrite(ledG, LOW);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, HIGH);

  digitalWrite(ledC, HIGH);

}

 

void eight()

{

  //Displays 8

  digitalWrite(ledD, HIGH);

  digitalWrite(ledE, HIGH);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, HIGH);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, HIGH);

  digitalWrite(ledC, HIGH);

}

 

void nine()

{

  //Displays 9

  digitalWrite(ledD, HIGH);

  digitalWrite(ledE, LOW);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, HIGH);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, HIGH);

  digitalWrite(ledC, HIGH);

}

 

void zero()

{

  //Displays 0

  digitalWrite(ledD, HIGH);

  digitalWrite(ledE, HIGH);

  digitalWrite(ledF, HIGH);

  digitalWrite(ledG, LOW);

  digitalWrite(ledA, HIGH);

  digitalWrite(ledB, HIGH);

  digitalWrite(ledC, HIGH);

}

 

void LoopDisplay()

{

  char_A();

  delay(1000);

  char_B();

  delay(1000);

  char_C();

  delay(1000);

  char_D();

  delay(1000);

  char_E();

  delay(1000);

  char_F();

  delay(1000);

  one();

  delay(1000);

  two();

  delay(1000);

  three();

  delay(1000);

  four();

  delay(1000);

  five();

  delay(1000);

  six();

  delay(1000);

  seven();

  delay(1000);

  eight();

  delay(1000);

  nine();

  delay(1000);

  zero();

  delay(1000);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요