Nguyên văn bởi mosquito
Xem bài viết
Thân,
#include <16F877.h> #fuses NOWDT,NOLVP,XT #use delay(clock=4000000) #byte portb=0x6 #byte portc=0x8 void main() {unsigned int i,j,count=0; byte const digits[]={0x3B,0x3F,0x06,0x53,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F} while (true) { if(count <=10) { if(i<=10) {portb=digits[i]; for(j=0;j<=10;j++) { portc=digits[j]; delay_ms(1000); j++; } i++; } } } }
SIGNAL CLK1mh_buf :STD_LOGIC; SIGNAL CLK1kh_buf :STD_LOGIC; SIGNAL CLK100h_buf :STD_LOGIC; SIGNAL CLK10h_buf :STD_LOGIC; SIGNAL CLK1h_buf :STD_LOGIC; signal led_buf :STD_LOGIC_VECTOR(7 DOWNTO 0):="11111111"; SIGNAL I_BCD: std_logic_vector(3 downto 0); signal idata :std_logic_vector(15 downto 0);--:="1111111111111";--max 8191 signal nghin_BCD :STD_LOGIC_VECTOR(3 DOWNTO 0); signal tram_BCD :STD_LOGIC_VECTOR(3 DOWNTO 0); signal truc_BCD :STD_LOGIC_VECTOR(3 DOWNTO 0); signal donvi_BCD :STD_LOGIC_VECTOR(3 DOWNTO 0);
Comment