Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调试IIC时,初始化出不来, #34

Open
kaihuaa opened this issue Nov 30, 2022 · 1 comment
Open

调试IIC时,初始化出不来, #34

kaihuaa opened this issue Nov 30, 2022 · 1 comment

Comments

@kaihuaa
Copy link

kaihuaa commented Nov 30, 2022

void TwoWire::set_scl(bool state)
{
I2C_DELAY(this->i2c_delay);
digitalWrite(this->scl_pin, state);
//Allow for clock stretching - dangerous currently
if (state == HIGH)
{
while(digitalRead(this->scl_pin) == 0);
}
}

卡在了 while里面 请问这个 while有什么作用

@FASTSHIFT
Copy link
Owner

这边是确保时钟线被拉高。
I2C两根线有上拉电阻吗?尝试取消FULL_SPEED_I2C宏定义。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants