-21%












8位 七段顯示器模組 八位 串列控制 max7219晶片 驅動
0 out of 5
NT$120 原始價格:NT$120。NT$95目前價格:NT$95。 (未稅)
- 描述
- 評價 (0)
描述
描述
8位 七段顯示器模組 八位 串列控制 MAX7219 晶片 驅動
- 採用MAX7219 驅動數碼管,需要單片機3路IO口,根據數碼管動態掃描原理進行顯示;
- 寬工作電壓3.3V到5V;
- PCB板尺寸:71mm*22mm
- 數碼管型號:0.36 4位共陽
8 digital LED Display Module eight serial module MAX7219 drives
- Use two MAX7219 digital control, 3-way needed microcontroller IO port, according to the digital display dynamic scanning principle
- Wide Operating Voltage: 3.3V to 5V
- Digital Tube Model: 0.36 4 common anode
- PCB Plate Size: 71X22X10mm/2.79*0.86*0.39″”
Arduino 範例一
Arduino
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
/* Modify from Liquid Crystal example For 8 x 7 segment module */ #define LATCH 12 //pin 12 of BBFuino connect to RCK of 8x7segment module #define CLOCK 11 //pin 11 of BBFuino connect to SCK of 8x7segment module #define DATA 10 //pin 10 of BBFuino connect to DIO of 8x7segment module #define LED 13 //LED is connected to pin 13 of Arduino #define MultiplexDelay 1 //delay for multiplexing between digit on 8x7segment module #define LEFT 0 // define the value for left justify #define RIGHT 1 // define the value for right justify #define BLANK 11 //array element to make 7segment blank // array to activate particular digit on the 8x7segment module // it is the common anode of 7 segment byte anode[8] = { 0b10000000, //digit 1 from right 0b01000000, //digit 2 from right 0b00100000, //digit 3 from right 0b00010000, //digit 4 from right 0b00001000, //digit 5 from right 0b00000100, //digit 6 from right 0b00000010, //digit 7 from right 0b00000001 //digit 8 from right }; //array for decimal number, it is the cathode, please refer to the datasheet. //therefore a logic low will activete the particular segment //PGFEDCBA, segment on 7 segment, P is the dot byte cathode[12] = {0b11000000, // 0 0b11111001, // 1 0b10100100, // 2 0b10110000, // 3 0b10011001, // 4 0b10010010, // 5 0b10000010, // 6 0b11111000, // 7 0b10000000, // 8 0b10010000, // 9 0b01111111, //dot 0b11111111 //blank }; //fucntion to send the serial data out to two 74HC595 serial to parallel shift register and activate the 7 segment. void display8x7segment(byte datapin, byte clockpin, byte latchpin, byte digit, byte number) { digitalWrite(latchpin, LOW); shiftOut(datapin, clockpin, MSBFIRST, digit); // clears the right display shiftOut(datapin, clockpin, MSBFIRST, number); // clears the left display digitalWrite(latchpin, HIGH); } //function to display value on 8x7 segment display according to the justify state void displayNumber8x7segment(byte justify, unsigned long value) { byte decimal[8] = {0}; value = value % 100000000; //ensure the value is within 8 digits only decimal[7] = value / 10000000; //extract digit 7 from value value = value % 10000000; //extract the rest of 7 digit value decimal[6] = value / 1000000; value = value % 1000000; decimal[5] = value / 100000; value = value % 100000; decimal[4] = value / 10000; value = value % 10000; decimal[3] = value / 1000; value = value % 1000; decimal[2] = value / 100; value = value % 100; decimal[1] = value / 10; decimal[0] = value % 10; byte zero = 0; if (justify == RIGHT) { for(byte e = 8; e > 0 ; e --) { if(zero == 0) { if(decimal[e-1] != 0) { display8x7segment(DATA, CLOCK, LATCH, anode[e-1], cathode[decimal[e-1]]); zero = 1; } } else display8x7segment(DATA, CLOCK, LATCH, anode[e-1], cathode[decimal[e-1]]); delay(MultiplexDelay); } } else //if justify == left { byte d = 0; for(byte e = 8; e > 0; e --) { if(zero == 0) { if(decimal[e-1] != 0) { display8x7segment(DATA, CLOCK, LATCH, anode[7], cathode[decimal[e-1]]); zero = 1; d ++; delay(MultiplexDelay); } } else { display8x7segment(DATA, CLOCK, LATCH, anode[7-d], cathode[decimal[e-1]]); d ++; delay(MultiplexDelay); } } } } void setup() { pinMode(LATCH, OUTPUT); pinMode(CLOCK, OUTPUT); pinMode(DATA, OUTPUT); pinMode(LED, OUTPUT); digitalWrite(LATCH, HIGH); digitalWrite(LED, LOW); //off LED // set up the LCD's number of columns and rows: delay(1000); //delay for 1 second } void loop(){ //1st demo, 8x7segment will display decimal value from 0 to 9 and dot from 1st digit (most right) until the last digit (most right) for(byte i = 0; i < 8; i++) { for(byte k = 0; k < 11; k++) { display8x7segment(DATA, CLOCK, LATCH, anode[i], cathode[k]); delay(300); } } delay(1000); //delay 1 second //2nd demo, 8x7segment will display same decimal from 0 to 9 and dot across all 8 digit for(byte k = 0; k < 11; k++) { display8x7segment(DATA, CLOCK, LATCH, 0xff, cathode[k]); //activate all digit delay(300); } delay(1000); //delay 1 second //3rd demo, 8x7segment will display a decimal value increasing like normal counter. for (unsigned long value = 0; value < 100000000; value ++) { for(byte i = 0; i < 10 ; i ++) { displayNumber8x7segment(RIGHT, value); //display the value in right justify format } } delay(1000); } |
評價 (0)
相關商品
-
-
LED / LCD / 液晶屏
Arduino LCD Keypad Shield LCD1602 液晶螢幕按鍵擴展板
0 out of 5NT$180原始價格:NT$180。NT$165目前價格:NT$165。 (未稅)加入購物車產品速覽 -
LED / LCD / 液晶屏
5MM 全彩 RGB 超高亮LED 燈珠共陰四腳 10隻
0 out of 5NT$25原始價格:NT$25。NT$20目前價格:NT$20。 (未稅)加入購物車產品速覽 -
LED / LCD / 液晶屏
4位元數碼管顯示模組 LED亮度可調 帶時鐘點 TM1637驅動
0 out of 5NT$47原始價格:NT$47。NT$38目前價格:NT$38。 (未稅)加入購物車產品速覽
商品評價
目前沒有評價。