Home > Back-end >  The intersection traffic lights
The intersection traffic lights

Time:12-27

Program, implement the following function, can use a variety of methods to realize,
Requirements are as follows:
1) through a user defined type, defines an unsigned character into BYTEPORT type,
2) by defining a variable BYTEPORT types, among them 6 bit control an intersection traffic lights, each bit control different intersections of a color lamp, 1, 0,
3) assumes that the intersection is something - north-south, two directions have red, green, yellow color of the traffic instructions, yellow light is always inserted into five seconds between green turn red,
4) requires a 1 s delay function by programming, input two crossing the red light, green light, out of time (unit, call a second function as a parameter to achieve the requirements of the time),
Programming realization of traffic light control,

Bosses help me
Unsigned char types of variables can be only one character at a time, but to six byte is at least 32, this is the two characters!
And the problem is what idea to write... I only know is to use in place, but no clue!

CodePudding user response:

A section of the/a domain structure, understand?
  • Related