8051 traffic light

Thread Starter

hyman

Joined Dec 27, 2007
3
Please help I need a traffic light code in C , i have in Assembly but want the C using Ride Ide to debug and run.

Thanks
 

Thread Starter

hyman

Joined Dec 27, 2007
3
Please help I need a traffic light Source code in C , i have it in Assembly but want the C using Ride Ide to debug and run.

Thanks
 

beenthere

Joined Apr 20, 2004
15,819
We heard you the first time.

Are you looking for the C programming language, or do you want someone to just give you the C code as a completed project?
 

Pootworm

Joined May 18, 2007
29
I believe a standard traffic engineering algorithm contains the following snippet:

Rich (BB code):
...

while( true ) {

  setLight( LIGHT_RED );

  if( isHeadingToWork( pootworm ) || isLowOnGas( pootworm ) ) {
    delay( 1000 );
  }
  else {
    delay ( 5 );
  }

...
 

beenthere

Joined Apr 20, 2004
15,819
Some more effort on your part is called for. You may not get any more code than the snippet pootworm contributed. Code-on-demand is not the purpose of these forums.

We will help, but you need to actually do the work. If you have the traffic light control function in assembler, then duplicating it in C sounds a bit busy. Is there some problem with the assembler code? We might be able to help with that.
 
Top