EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / i can tell you one logic for

i can tell you one logic for

|

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

RSS feed: Recent Posts Recent Posts

  • Delco alternator (12SI) AC-tap - what is the mate to this connector called and where to find it? October 9, 2026
  • Frustration, single phase, high KW, high voltage battery charge module, rectifier. October 9, 2026
  • Almost Very New in PCB / KICAD DESIGN October 9, 2026
  • Vehicle alternator regulator - use external regulator, connect field lead to "lamp" ("D") ??? October 9, 2026
  • solderless sma screw mounting RF causaliy problem October 8, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 Arrowfly LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of Arrowfly
Privacy Policy | Advertising

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise