跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[问与答] 请教下 V 社大神,关于 esp32 的相关问题(付费寻找技术支持)

发表于

我用的是 esp32 S3 的芯片,使用下方展示的代码,扫不到任何 i2c 设备,而且会卡在 Wire.begin(31,30),然后无限 setup 。不传引脚则正常运行,提示"No I2C devices foundn"。

1724893004556-6432cd4e-e0c6-40d2-aee5-51
#include <Wire.h>

void setup() {
    Wire.begin(31,30);
    Serial.begin(115200);
    Serial.println("nI2C Scanner");
    byte error, address;
    int nDevices;
    Serial.println("Scanning...");
    nDevices = 0;
    for(address = 1; address < 127; address++ ) {
        Wire.beginTransmission(address);
        error = Wire.endTransmission();
        if (error == 0) {
            Serial.print("I2C device found at address 0x");
            if (address<16) {
                Serial.print("0");
            }
            Serial.println(address,HEX);
            nDevices++;
        }
        else if (error==4) {
            Serial.print("Unknown error at address 0x");
            if (address<16) {
                Serial.print("0");
            }
            Serial.println(address,HEX);
        }    
    }
    if (nDevices == 0) {
        Serial.println("No I2C devices foundn");
    }
    else {
        Serial.println("donen");
    }
    delay(5000);  
    Serial.print("i2c devices found:");
    Serial.println(nDevices); 
}

void loop() {

}

因为电路图是外包公司画的(我再也不找外包了😭),现在做了几个样板,用起来有一些问题,电路图我看不太懂,现在在找靠谱的大神,付费请教一些问题。有相关经验的可以V:Taxze2019

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.