Microcontroller › 8051 › source code › i can tell you one logic for
October 20, 2010 at 3:48 pm
#5106
dagakshay
Participant
i can tell you one logic for this,
just make use of hardware interrupt,
declare temp as global variable and keep on incrementing that in your main loop and make it one as it counts beyond six
while(1)
{
temp= temp++;
if(temp>6) //since a dice has only six faces
temp=1;
}
//and in ISR
ISR(INT0_vect)
{
//use case and make your leds(or 7 segment if using) accodingly
}
apply that logic and code yourself for 8051