I have an Attiny 45 and an arduino nano.
I want to connect them with I2C so that I can control the other LED with it.
How can I programm it?
I have an Attiny 45 and an arduino nano.
I want to connect them with I2C so that I can control the other LED with it.
Here is the definitive guide to I2C and Arduino: Gammon Forum : Electronics : Microprocessors : I2C - Two-Wire Peripheral Interface - for Arduino
You'll see that the role of I2C master and I2C slave can be interchanged, which you'll need in this case.
If you have also another Nano or Uno, start with that instead of the ATtiny45. Use the ATtiny45 only when you have solved all the other problems.
Incidentally, it would be good to use series resistors with the leds (say 330 ohm).
Is you Nano a classic or an Every ?
It is an Every .
Thank you!
Welcome.
What are you trying to do in your project? If the project just involves 4 buttons and 4 leds, then you certainly don't need an extra Attiny for this. The single nano will do and you can use the millis() function for multitasking.
An Arduino I2C master and Attiny slave should work fine however, and here is a very good tutorial: Use I2C for communication between Arduinos. Keep the Arduino as the master and the Attiny as the slave, and have the master send requests to the slave if you need 2 way communication Master Requester Example
I want to send the signal to another apartment nearby.
what do you mean by "send the signal"?
Over I2C? I2C was designed for use on PCBs, distances of something like 25 cm. You can stretch it a bit but it will get tricky (and outside my area of expertise).
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.