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
Traffic Lights Control using Assembly
Page 1 of 14 Replies - 5420 Views - Last Post: 10 November 2008 - 05:08 AM
Replies To: Traffic Lights Control using Assembly
#2
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?
#3
Re: Traffic Lights Control using Assembly
Posted 10 November 2008 - 03:48 AM
born2c0de, 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
#4
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?
#5
Re: Traffic Lights Control using Assembly
Posted 10 November 2008 - 05:08 AM
n8wxs, 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
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|