home/uli/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.h:79:10: note: candidate: bool TwoWire::begin(int, int, uint32_t)īool begin(int sda=-1, int scl=-1, uint32_t frequency=0) // returns true, if successful init of i2c bus In file included from include/MyIO.hpp:2:0, Src/NyI2C.cpp:139:47: error: call of overloaded 'begin(const int&, const int&, int)' is ambiguous When I let D4 “float”, the LED turned on.You are trying to call Wire.begin() for I2C using Wire.begin(Pin_I2C_SDA, Pin_I2C_SCL, 400000) īut you see an error message like src/MyI2C.cpp: In function 'void MyInitI2C()': When I grounded D4 on the Spark, the LED went out. On the arduino side, I used this code: #include īecause I used a 3.3V Arduino pro mini, I put an LED to ground via a resistor on digital pin 3. Also, note I removed the boolean on the last_state and made it an INT since that’s what digitalRead returns. The original code was looking for a change in the button and would xmit that change to the slave. The button “bebounce” that BDub suggested was great but that is not what was needed. ![]() First, as per timb, I made the Spark the master with this code: #include "application.h" ![]() Here’s the code I’m running on the Core: #define LED D7Īny help would be greatly appreciated, thanks in advance.Įverything is working! However, there are a couple of things I had to fix. I have the code working between 2 Unos but not to the Core. The intension was to use this sketch to confirm I have the I2C communication working before using it in “real” applications. I have connections between D0 -> A4 and D1 -> A5, both with 4k7 pull-up resistors, GND -> GND and +5 -> Vin.įor now I’m just trying to press a switch on one board and have the on-board LED light on the other. ![]() I’m having some issues communicating between a Spark Core and an Arduino Uno via I2C.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |