Farikh_ notes


Counter up dan counter down pada dua digit sevensegment

Posted in mikrokontroller oleh farikhardiansyah pada Desember 18, 2012

Pada projek ini saya menggunakan dua digit seven segment, yaitu seven segment tipe common anoda. Karena saya menggunakan dua digit sevensegment maka nilai maksimal yang dapat ditunjukkan adalah 99.

Rangkaian counter sevensegment pada proteus dapat dilihat pada gambar dibawah ini :

rangkaian

Untuk source programnya saya menggunakan codevision AVR. Berikut source programnya :

Chip type                                  : ATmega8535

Program type                           : Application

AVR Core Clock frequency    : 4,000000 MHz

Memory model                         : Small

External RAM size                   : 0

Data Stack size                          : 128

*****************************************************/

#include <mega8535.h>

#include <delay.h>

unsigned char bil [10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};

int sat,pul,rat,rib,i;

// Declare your global variables here

void counter_up()

{

for (sat=0;sat<10;sat++)

{

for (pul=0;pul<10;pul++)

{

for (i=0;i<1000;i++)

{

PORTB=0x02;

PORTA=bil[sat];

delay_us(250);

PORTB=0x01;

PORTA=bil[pul];

delay_us(250);

}

}

}

}

void counter_down()

{

for (sat=9;sat>=0;sat–)

{

for (pul=9;pul>=0;pul–)

{

for (i=200;i>0;i–)

{

PORTB=0x02;

PORTA=bil[sat];

delay_us(250);

PORTB=0x01;

PORTA=bil[pul];

delay_us(250);

}

}

}

}

while (1)

{

// Place your code here

counter_up();

counter_down();

};

}

Semoga temen-temen dapat berkreasi dengan program counternya.

Semoga bermanfaat 😀

9 Tanggapan to 'Counter up dan counter down pada dua digit sevensegment'

Subscribe to comments with RSS atau TrackBack to 'Counter up dan counter down pada dua digit sevensegment'.

  1. lm aliasri bosa said,

    mantap bro.. lanjutkan..


  2. What’s up mates, how is everything, and what you desire to say about this piece of writing, in my view its actually awesome in support of me.

  3. arfy said,

    tetep exsis berbagi sourcode ane tunggu yg terbaru hehehe,,,


    • terima kasih gan…
      insyaAllah akan exis berbagi…

  4. billig ipad said,

    hi!,I really like your writing so so much! proportion we communicate more approximately your article on AOL?
    I need a specialist on this space to unravel my problem.
    Maybe that is you! Looking ahead to peer you.


  5. What’s Going down i’m new to this, I stumbled upon this I’ve found It positively useful and it has helped me out loads. I’m hoping to contribute
    & aid other users like its helped me. Great job.

  6. 7:07 pm said,

    Exceptional post however I was wanting to know if you could write a litte more on
    this subject? I’d be very thankful if you could elaborate a little bit more. Bless you!


  7. Hi! Do you use Twitter? I’d like to follow you if that would be ok. I’m absolutely enjoying your blog and
    look forward to new updates.


Tinggalkan komentar