一、位段
#include <stdio.h>
#include <stdlib.h>
typedef unsigned char Uchar;
typedef unsigned int Uint;
union char_bin
{
Uchar ch;
struct
{
Uchar bit0 :1;
Uchar bit1 :1;
Uchar bit2 :1;
Uchar bit3 :1;
Uchar LED4 :1;
Uchar bit5 :1;
Uchar bit6 :1;
Uchar bit7 :