Implemented usage example
This commit is contained in:
1 parent
4075cb4e63
commit
e82fb9971e
2 files changed
+14
-1
No files matched your search
+1
-1
Submodule i2c/i2c updated: 939cdc1196...629be83f8a.
@@ -8,8 +8,21 @@ void i2cTest()
|
||||
using config = Hardware<Prescaler::PRESCALER_1, 100000>;
|
||||
|
||||
I2c<config> twi;
|
||||
constexpr auto I2CADDRESS = 0x4B;
|
||||
|
||||
twi.init();
|
||||
|
||||
if (!twi.start<I2CADDRESS>(false)) {
|
||||
twi.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!twi.write(0x7F)) {
|
||||
twi.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
twi.stop();
|
||||
}
|
||||
|
||||
int main()
|
||||
|
||||
Reference in new issue
Block a user