raemondbw / swire Goto Github PK
View Code? Open in Web Editor NEWSoftware implementation of I2C for Arduino (Tested with the atmega328p based boards)
License: MIT License
Software implementation of I2C for Arduino (Tested with the atmega328p based boards)
License: MIT License
i am having a hardtime reading the value from MPU6050
the address is 0x68 but can you explain why its changing to 0xD1 in requestFrom(uint8_t address, uint8_t numBytes)
if (writeByte(((current_rw_address << 1) | 1) & 0xFF)) {
stop();
return 0;
}
i am new to this library so dont mind if i made mistake
Hi, I have not tested your SWire library yet, but I noticed a few things.
The Wire.available() should return the number of valid bytes in the rxBuffer.
Writing a 16-bit value is not according to the Arduino Wire library. Please don't add that. It is very confusing and might result into different functionality between the Arduino Wire library and your SWire library. I will guaranteed cause a lot of trouble.
You mix HIGH and LOW with 1 and 0. They are the same, but from a programmers viewpoint they are different things. Perhaps you can make it more obvious what is used in the code.
The buffer length is only 8 bytes ? The Arduino Wire library for AVR chips has 32 bytes.
Is it possible to do a Wire.beginTransmission() followed by a Wire.endTransmission() to test the ACK of a sensor ? That is used in i2c scanner sketches. I did not test it, and I can not tell from the source if that will work.
What about making it more compatible ? Perhaps a (dummy) setClock(), a peek(), a end() and a flush(), en perhaps some functions from the Stream class.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.