Bundle SoftwareI2C library (with edits)

This commit is contained in:
ThePetrovich 2025-09-22 20:00:44 +08:00
parent 63583ce984
commit 70798b6bf7
13 changed files with 1390 additions and 0 deletions

View file

@ -0,0 +1,26 @@
// i2c scan
#include "SoftwareI2C.h"
SoftwareI2C softwarei2c;
void setup() {
Serial.begin(115200);
softwarei2c.begin(3, 2); // sda, scl
Serial.println("begin to scan...");
}
void loop() {
for (unsigned char i = 1; i <= 127; i++) {
if (softwarei2c.beginTransmission(i)) {
Serial.print("0x");
Serial.println(i, HEX);
while (1);
}
softwarei2c.endTransmission();
}
Serial.println("find nothing");
while (1);
}