C语言左移运算和位赋值

uint8_t DHT11_ReadByte(void)
{
    uint8_t byte = 0;
    for(uint8_t i = 0; i < 8; i++) {
        byte <<= 1; // 左移一位
        byte |= DHT11_ReadBit(); // 读取一位数据
    }
    return byte;
}

 https://mp.weixin.qq.com/s/0QuZ5M8sFsv3XJ01CliRUA

posted @ 2025-06-26 20:38  微笑的''80  阅读(13)  评论(0)    收藏  举报