io port programing chalange


Posted on Feb 6, 2014

This program is a simple Traffic Light Controller. Between start time and end time the system controls a traffic light with pedestrian self-service. Outside of this time range the yellow caution lamp is blinking. | ` `+ command -+ syntax -+ function -+ ` `| Display | D | display times Time | T hh:mm:ss | set clock time Start | S hh:mm:ss | set start time End


io port programing chalange
Click here to download the full size of the above Circuit.

| E hh:mm:ss | set end time | " "+-+-+-+ "; #include /* string and memory functions */ extern getline (char idata *, char); /* external function: input line */ extern serial_init (); /* external function: init serial UART */ #define INIT 0 /* task number of task: init */ #define COMMAND 1 /* task number of task: command */ #define CLOCK 2 /* task number of task: clock */ #define BLINKING 3 /* task number of task: blinking */ #define LIGHTS 4 /* task number of task: signal */ #define KEYREAD 5 /* task number of task: keyread */ #define GET_ESC 6 /* task number of task: get_escape */ struct time { /* structure of the time record */ unsigned char hour; /* hour */ unsigned char min; /* minute */ unsigned char sec; /* second */ }; struct time ctime = { 12, 0, 0 }; /* storage for clock time values */ struct time start = { 7, 30, 0 }; /* storage for start time values */ struct time end = { 18, 30, 0 }; /* storage for end time values */ sbit red = P12; /* I/O Pin: red lamp output */ sbit yellow = P11; /* I/O Pin: yellow lamp output */ sbit green = P10; /* I/O Pin: green lamp output */ sbit stop = P13; /* I/O Pin: stop lamp output */ sbit walk = P14; /* I/O Pin: walk lamp output */ sbit key = P15; /* I/O Pin: self-service key input */ char idata inline[16]; /* storage for command input line */ / <7465> */ /* Task 0 `init`: Initialize */ / <7465> */ void init (void) _task_ INIT { /* program execution starts here */ serial_init ();...




Leave Comment

characters left:

New Circuits

.

 


Popular Circuits

Minimal metal detector
Battery condition indicator
Telephone Bell Simulator Circuit
The Application of TDC-GP21 in Ultrasonic Heat Meter
400mA Micropower Synchronous Step-Up DC/DC Converter with Output Disconnect
VHF radio receiver
One variable speed single-phase motor circuit thyristor
Before power is in the release state holding brake circuit



Top