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:

Related Circuits

  • New Circuits

    .

     


    Popular Circuits

    Musical telephone ringer
    zn415 am radio with tda2822m amplifier
    police siren pcb
    45 Watt Class-B Audio Power Amplifier
    usb switch schematic circuit
    More op-amp circuits
    DC-DC converter to step up input voltage
    Visual Basic & AVR RS232 interface
    Port-O-Rotary
    Speed differential negative feedback circuit
    F007 excellent performance of low-frequency signal generator circuit



    Top