6Pin数码管驱动和编码器旋钮检测

6Pin数码管驱动和编码器旋钮检测 对应管脚推挽输出控制一节led亮起来其他管脚设置为输入高阻太每次显示一节都要在前面加上6pin输出为0防止所有节亮度不一致switch_pin_in_or_out(1, 0); switch_pin_in_or_out(2, 0); switch_pin_in_or_out(3, 0); switch_pin_in_or_out(4, 0); switch_pin_in_or_out(5, 1); switch_pin_in_or_out(6, 1); void INT0_Rpt() interrupt INT0_VECTOR { PINTF0 ~0x01; // 清除INT0中断标志位 // if (s2 !P0_1) // { // add_del 2; // s1 0; // s2 0; // } // else if (P0_1) // { // s1 1; // } if(s2 (P0_0 P0_1)) { add_del2; s10; s20; } else { s11; s20; } } void INT1_Rpt() interrupt INT1_VECTOR { PINTF0 ~0x02; // 清除INT1中断标志位 // if (s1 !P0_0) // { // add_del 1; // s1 0; // s2 0; // } // else if (P0_0) // { // s2 1; // } if(s1 (P0_0 P0_1)) { add_del1; s10; s20; } else { s10; s21; } }