4 Replies - 6878 Views - Last Post: 10 November 2008 - 05:08 AM Rate Topic: -----

#1 r.mota  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 09-November 08

Traffic Lights Control using Assembly

Post icon  Posted 09 November 2008 - 06:22 PM

Hi all!

I am writing an assembly 8086 code for control of traffic lights using the virtual device of 8086.

The problem is, the traffic lights will light at different time at different hours of the day and i would like you suggest me how is the manner more efficient to check the time of the day and see which time interval the program is for assign the different times for lights.

Regards,

Ricardo Mota

Is This A Good Question/Topic? 0
  • +

Replies To: Traffic Lights Control using Assembly

#2 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: Traffic Lights Control using Assembly

Posted 10 November 2008 - 02:53 AM

Are you displaying Traffic Lights on the Screen or by using LEDs?
Was This Post Helpful? 0
  • +
  • -

#3 r.mota  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 09-November 08

Re: Traffic Lights Control using Assembly

Posted 10 November 2008 - 03:48 AM

View Postborn2c0de, on 10 Nov, 2008 - 01:53 AM, said:

Are you displaying Traffic Lights on the Screen or by using LEDs?



I am using a emulator with LEDs but I have this already done. The problem is, I have a table like this:


Start Time | Via1(time) | Via2(time)
------------------------------------------------
07:30:00 80% 20%
10:00:00 50% 50%
17:25:10 35% 65%


This are time intervals for functioning of traffic lights, the percentage is the time the green LED will light of a cycle of 'n' seconds.

My question is how my program when starts will know which interval of the day it's located for functioning according to system time and how to check the time to see if i've already entered in another interval... This table is for demonstration only and i could have more lines of these time intervals and with different intervals.


Thank you for the support.

Ricardo Mota
Was This Post Helpful? 0
  • +
  • -

#4 n8wxs  Icon User is offline

  • --... ...-- -.. . -. ---.. .-- -..- ...
  • member icon

Reputation: 972
  • View blog
  • Posts: 3,878
  • Joined: 07-January 08

Re: Traffic Lights Control using Assembly

Posted 10 November 2008 - 03:53 AM

Does the operating environment your code runs under have a clock() or time_of_day() function?
Was This Post Helpful? 0
  • +
  • -

#5 r.mota  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 09-November 08

Re: Traffic Lights Control using Assembly

Posted 10 November 2008 - 05:08 AM

View Postn8wxs, on 10 Nov, 2008 - 02:53 AM, said:

Does the operating environment your code runs under have a clock() or time_of_day() function?




Not at all I only have at my dispose the 8086 instruction Set and dos interrupt instruction codes. I think there is an interrupt that returns the time of the day in ax, dx, and cx in hours, minutes and seconds but i don't know if it's one of the solutions to my problem.

By the way the environment where my code should run is the emu8086 emulator. Check http://www.emu8086.com

Regards,

Ricardo Mota

This post has been edited by r.mota: 10 November 2008 - 05:11 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1