Lesson 13--Microduino Single Digital Display with A Point
Language: | English • 中文 |
---|
ObjectiveThis lesson will teach you how to use digital tube to display numbers and the decimal point by Microduino. EquipmentMicroduino-Core Microduino-FT232R
Schematiclight the decimal point using sevseg.NewNum(9, 0), the second paramter uses to control the postion of decimal point. Pin Table:
ProgramDownload 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.
} DebugFristly download the library, uncompress 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: Step 3:Run program
ResultDigital will display number and decimal point. Video |