Counter up dan counter down pada dua digit sevensegment
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 :
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 😀
pada Desember 18, 2012 pada 4:24 am
mantap bro.. lanjutkan..
pada Desember 18, 2012 pada 10:18 am
mari belajar bersama teman….
pada Desember 29, 2012 pada 9:25 pm
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.
pada Januari 4, 2013 pada 8:00 pm
tetep exsis berbagi sourcode ane tunggu yg terbaru hehehe,,,
pada Januari 9, 2013 pada 8:55 pm
terima kasih gan…
insyaAllah akan exis berbagi…
pada Januari 7, 2013 pada 12:17 pm
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.
pada Januari 7, 2013 pada 9:40 pm
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.
pada April 8, 2013 pada 5:42 pm
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!
pada Juli 23, 2013 pada 2:11 pm
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.