Lesson 13--Microduino Single Digital Display with A Point

From Microduino Wiki
Revision as of 08:11, 12 September 2016 by Fengfeng (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Language: English  • 中文

Objective

This lesson will teach you how to use digital tube to display numbers and the decimal point by Microduino.

Equipment

Microduino-Core Microduino-FT232R

  • Other hardware equipment
    • Breadboard Jumper one box
    • Breadboard one piece
    • Digital tube one
    • 20kΩ resistor (100Ω~1kΩ) one
    • 1uF capacitor (0.1uF~10uF) one
    • USB Data cable one


Schematic

第十三课-Microduino单个数码管带点显示原理图.jpg

light the decimal point using sevseg.NewNum(9, 0), the second paramter uses to control the postion of decimal point.

Pin Table:

Microduino Pin Digital Tube Pin
D10 1
D9 2
D5 3
D8 4
D13 5
D7 6
D6 7
Not used 8
D11 9
D12 10

Program

Download program: https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Advanced/MicroduinoDigitalShowPoint

    /*  

     7 segment digital tube:
          
               A
              ____
             |    |
          F  |____|  B
             | G  |
          E  |____|  C
                    o DP
               D
              
          Pin distribution:
          
          10 9 8 7 6
           ________
          |   __   |
          |  |__|  |
          |  |__|o |
          |________|
          
          1 2 3 4 5  
          
          * How to connect to Microduino?
          * Check the Pin 3 and 9 firstly, generally they are grade-level, the digital tube in kit is common anode, so they both are anode, we can use any of them.
          * 1 (E) Connect to Microduino Pin 10
          * 2 (D) Connect to Microduino Pin 9
          * 3  Because only use one digital tube, so this pin or pin 8 connects to Microduino Pin 5
          * 4 (C) Connect to Microduino Pin 8
          * 5 (DP) Connect to Microduino Pin 13
          * 6 (B) Connect to Microduino Pin 7
          * 7 (A) Connect to Microduino Pin 6
          * 8 Because only use one digital tube, so this pin or pin 3 connects to Microduino Pin 5
          * 9 (F) Connect to Microduino Pin 11
          * 10 (G) Connect to Microduino Pin 12
          
    */
     
    #include "SevSeg.h"
    SevSeg sevseg;
    void setup() {
    //Define the used pin
		sevseg.Begin(1,2,3,4,5,6,7,8,9,10,11,12,13);
     
    }
     
    void loop() {
      //Enable output function
		sevseg.PrintOutput();
        sevseg.NewNum(9, 0);     //Digital tube function outputs number, the second parameter is the positon of decimal point. 
      }

Debug

Firstly download the library, unzip it and put to libraries folder of Arduino IDE, then restart Arduino IDE to load library.

Library link: https://docs.google.com/file/d/0Bwrp4uluZCpNN1Q4dmFZX1MzWVE/edit

This library can drive 4bits digital tube and support number, decimal point and easy to use.

Step 1: Copy the code to IDE and compile it.

Step 2: Set up circuit, as follows:

第十三课-Microduino单个数码管带点显示连接图.jpg

Step 3: Run program


Result

Digital will display number and decimal point.

Video