پاسخ : شمارنده دیجیتال بوبین پیچ
85000 تومان؟؟؟!!! :eek: :eek:
همین شماتیک + یه میکرو + 3 تا سون سگمت = همونی که میخوای!!!!
85000 تومان؟؟؟!!! :eek: :eek:
همین شماتیک + یه میکرو + 3 تا سون سگمت = همونی که میخوای!!!!
/***************************************************** This program was produced by the CodeWizardAVR V2.05.3 Standard Automatic Program Generator © Copyright 1998-2011 Pavel Haiduc, HP InfoTech s.r.l. http://www.hpinfotech.com Project : Version : Date : 09/05/2013 Author : PerTic@n Company : If You Like This Software,Buy It Comments: Chip type : ATmega8 Program type : Application AVR Core Clock frequency: 4.000000 MHz Memory model : Small External RAM size : 0 Data Stack size : 256 *****************************************************/ #include <mega8.h> #include <delay.h> #define xtal 8000000 flash char buf[] = { 0b11111100, //0 0b01100000, //1 0b11011010, //2 0b11110010, //3 0b01100110, //4 0b10110110, //5 0b10111110, //6 0b11100000, //7 0b11111110, //8 0b11110110, //9 0b00000000 }; unsigned char a; int b,b=0; int c,c=0; int d,d=0; int e,f=0; // External Interrupt 0 service routine interrupt [EXT_INT0] void ext_int0_isr(void) { b++; if (b==10){ c++; b=0; if (c==10){ d++; c=0; if (d==10){ e++; d=0; if (e==10){ b=0; c=0; d=0; e=0; } } } } } // Declare your global variables here void main(void) { DDRC=0x00; PORTC=0xFF; DDRB=0xFF; PORTB=0x00; TCCR0=0x00; TCNT0=0x00; // Timer/Counter 1 initialization // Clock source: System Clock // Clock value: Timer1 Stopped // Mode: Normal top=0xFFFF // OC1A output: Discon. // OC1B output: Discon. // Noise Canceler: Off // Input Capture on Falling Edge // Timer1 Overflow Interrupt: Off // Input Capture Interrupt: Off // Compare A Match Interrupt: Off // Compare B Match Interrupt: Off TCCR1A=0x00; TCCR1B=0x00; TCNT1H=0x00; TCNT1L=0x00; ICR1H=0x00; ICR1L=0x00; OCR1AH=0x00; OCR1AL=0x00; OCR1BH=0x00; OCR1BL=0x00; // Timer/Counter 2 initialization // Clock source: System Clock // Clock value: Timer2 Stopped // Mode: Normal top=0xFF // OC2 output: Disconnected ASSR=0x00; TCCR2=0x00; TCNT2=0x00; OCR2=0x00; // External Interrupt(s) initialization // INT0: On // INT0 Mode: Rising Edge // INT1: Off GICR|=0x40; MCUCR=0x03; GIFR=0x40; // Timer(s)/Counter(s) Interrupt(s) initialization TIMSK=0x00; // USART initialization // USART disabled UCSRB=0x00; // Analog Comparator initialization // Analog Comparator: Off // Analog Comparator Input Capture by Timer/Counter 1: Off ACSR=0x80; SFIOR=0x00; // ADC initialization // ADC disabled ADCSRA=0x00; // SPI initialization // SPI disabled SPCR=0x00; // TWI initialization // TWI disabled TWCR=0x00; #asm("sei") while(1){ PORTB.7=1; PORTB.6=1; PORTB.5=1; PORTB.4=1; for(a=0; a<8; a++){ PORTB.0 = buf[b] & 1<<a; PORTB.1=0; PORTB.1=1; }; PORTB.4=0; PORTB.2=0; PORTB.2=1; delay_us(100); PORTB.7=1; PORTB.6=1; PORTB.5=1; PORTB.4=1; for(a=0; a<8; a++){ PORTB.0 = buf[c] & 1<<a; PORTB.1=0; PORTB.1=1; }; PORTB.5=0; PORTB.2=0; PORTB.2=1; delay_us(100); PORTB.7=1; PORTB.6=1; PORTB.5=1; PORTB.4=1; for(a=0; a<8; a++){ PORTB.0 = buf[d] & 1<<a; PORTB.1=0; PORTB.1=1; }; PORTB.6=0; PORTB.2=0; PORTB.2=1; delay_us(100); PORTB.7=1; PORTB.6=1; PORTB.5=1; PORTB.4=1; for(a=0; a<8; a++){ PORTB.0 = buf[e] & 1<<a; PORTB.1=0; PORTB.1=1; }; PORTB.7=0; PORTB.2=0; PORTB.2=1; delay_us(100); }; }
دیدگاه