Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 MikroC Pro for PIC16f73 复用 7 段,编写的程序为:
PORTB = Hex (x%10);
PORTB意味着总共包含 8 个引脚RB0,RB7但我只想将 7 个引脚用于 7 个段RB0,而作为其他 O/PRB6的引脚仅为 0 或 1。RB7
PORTB
RB0
RB7
RB6
喜欢和Rb0_Rb6 = hex (x%10)Rb7_bit = 0 or 1
Rb0
Rb6 = hex (x%10)
Rb7_bit = 0 or 1
那么如何定义线Rb0 to Rb6 = hex (x%10);
Rb0 to Rb6 = hex (x%10);
尝试这个:
uint8_t Pin_Value; Pin_Value = Hex (x%10); Pin_Value |= 0x80; //set bit RB7 Pin_Value &= 0x7F; //clear bit RB7 PORTB = Pin_Value;