Keil RTX51 Manual page 50

Table of Contents

Advertisement

50
SERIAL.C
GETLINE.C
TRAFFIC.C
/*****************************************************************************
*/
/*
*/
/*
*/
/*
*/
/*****************************************************************************
*/
code char menu[] =
"\n"
"+***** TRAFFIC LIGHT CONTROLLER using C51 and RTX-51 tiny *****+\n"
6
"| This program is a simple Traffic Light Controller.
"| start time and end time the system controls a traffic light
"| with pedestrian self-service.
"| the yellow caution lamp is blinking.
"+ command -+ syntax -----+ function ---------------------------+\n"
"| Display
"| Time
"| Start
"| End
"+----------+-------------+-------------------------------------+\n";
#include <reg52.h>
*/
#include <rtx51tny.h>
*/
#include
*/
#include
*/
#include <string.h>
*/
• Task 4 Lights: controls the traffic light phases while the clock time is
in the active time range (between the start and end times).
• Task 5 Button: reads the pedestrian push button and sends signals to
the lights task.
• Task 6 Quit: checks for an ESC character in the serial stream. If one
is encountered, this task terminates a previously specified display
command.
implements an interrupt driven serial interface. This file contains the
functions putchar and getkey. The high-level I/O functions printf and
getline call these basic I/O routines. The traffic light application will also
operate without using interrupt driven serial I/O. but will not perform as
well.
is the command line editor for characters received from the serial port.
This source file is also used by the MEASURE application.
TRAFFIC.C:
Traffic
| D
| display times
| T hh:mm:ss
| set clock time
| S hh:mm:ss
| set start time
| E hh:mm:ss
| set end time
<stdio.h>
<ctype.h>
Light
Controller
using
Outside of this time range
/* special function registers 8052
/* RTX-51 tiny functions & defines
/*
/*
/* string and memory functions
Application Examples
the
C51
Compiler
Between
|\n"
|\n"
|\n"
|\n"
|\n"
|\n"
|\n"
|\n"
standard
I/O
.h-file
character
functions

Advertisement

Table of Contents
loading

Table of Contents