![]() You don't need to activate the pullup resistors, you can remove that.Īrduino was split into and. I really have to know which boards you use. And now I also want to know what you use for pullup resistor and if you can make a photo of the wiring. It is easier for me if I know a few things, but you didn't answer my questions in Reply #1. Honest question at this point: Is I2C really such a "fickle beast", or are these just beginner's problems? produces good plausible floating point values in the serial monitor. Fuel consumption per hour and fuel gauge sensor level are calculated in this sketch this is working and Sketch for a car fuel consumption meter Variables are printed out on an LCD display code omitted. While (Wire.available()) // slave may send less than requestedĭata = Wire.read() // receive a byte as character Wire.requestFrom(2, 8) // request 8 bytes from slave device #2 4.7K resistors are also used on the master inputs. I have now abandoned trying to use I2C_Anything for the time being, and have tried my luck with sending the floats as bytes and then making unions at the other end. ![]() I'm running Arduino 1.7.4, so it's a fairly new version of the IDE. Wire.onRequest(requestEvent) // register event Wire.begin(MY_ADDRESS) // join i2c bus with address #2 ![]() Here's the I2C-relevant master code I've got so far: #include Īnd here's the slave code, to send data from the slave to the master: #include ![]() ![]() The values just aren't transmitted, and when I try to print them out via LCD display on the master, it just shows "nan" or "-1". I'm currently trying to send data (two floats and one integer analog reading between 0-1023) from a slave Arduino to a master Arduino, using I2C and the I2C_Anything.h library. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |