TMD~~睡不着了
写一段代码,方便修改对应的IO口。大神高手们先不要说话
- #define seg_a 0x01 // a
- #define seg_b 0x02 // ----
- #define seg_c 0x04 // f| |b
- #define seg_d 0x08 // | g |
- #define seg_e 0x10 // ----
- #define seg_f 0x20 // e| |c
- #define seg_g 0x40 // | d |
- #define sec_dp 0x80 // ---- . dp
- unsigned char seg[]={seg_a,seg_b,seg_c,seg_d,seg_e,seg_f,seg_g,sec_dp,0x00};
- unsigned char display[]={ //共阴极
- seg_a+seg_b+seg_c+seg_d+seg_e+seg_f, //0x3F, "0"
- seg_b+seg_c, //0x06, "1"
- seg_a+seg_b+seg_d+seg_e+seg_g, //0x5B, "2"
- seg_a+seg_b+seg_c+seg_d+seg_g, //0x4F, "3"
- seg_b+seg_c+seg_f+seg_g, //0x66, "4"
- seg_a+seg_c+seg_d+seg_f+seg_g, //0x6D, "5"
- seg_a+seg_c+seg_d+seg_e+seg_f+seg_g, //0x7D, "6"
- seg_a+seg_b+seg_c, //0x07, "7"
- seg_a+seg_b+seg_c+seg_d+seg_e+seg_f+seg_g,//0x7f, "8"
- seg_a+seg_b+seg_c+seg_d+seg_f+seg_g, //0x6F, "9"
- seg_a+seg_b+seg_c+seg_e+seg_f+seg_g, //0x77, "A"
- seg_c+seg_d+seg_e+seg_f+seg_g, //0x7C, "b"
- seg_a+seg_d+seg_e+seg_f, //0x39, "C"
- seg_b+seg_c+seg_d+seg_e+seg_g, //0x5E, "d"
- seg_a+seg_d+seg_e+seg_f+seg_g, //0x79, "E"
- seg_a+seg_e+seg_f+seg_g, //0x71, "F";
- seg_d+seg_e+seg_f+seg_g, //0x39, "t" //16
- };
复制代码
|