You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to link 2 Attiny85s, but the connection is very unreliable. When I connect the power for both boards at the same time I always get NACK, when I connect Slave first, wait until it boots ( 5 seconds Digispark Attiny85 ) I get communication half the time. I have 2k pull up resistors.
Here is the sketch I'm using:
#include<Arduino.h>
#include"TinyWire.h"
#defineMASTER1uint8_t array[32];
uint8_t address = 0x00;
voidblink(int time, int n)
{
for (int i = 0; i < n; i++)
{
digitalWrite(1, HIGH);
delay(time / 2);
digitalWrite(1, LOW);
delay(time / 2);
}
}
#if MASTER
voidsetup()
{
pinMode(1, OUTPUT);
blink(200, 3);
TinyWire.begin();
for ( int i = 0; i < 32; i++)
array[i] = i;
}
voidloop()
{
TinyWire.beginTransmission(0x46);
TinyWire.send(address);
for ( int i = 0; i < sizeof(array); i++)
TinyWire.send(array[i]);
if ( TinyWire.endTransmission() != 0)
blink (200, 5);
elseblink(1000, 1);
}
#else//SLAVEvoidreceiveEvent(int howMany)
{
byte c = 0;
while (TinyWire.available() > 0)
c = TinyWire.read();
blink(500, 1);
}
voidsetup()
{
pinMode(1, OUTPUT);
blink(200, 3);
TinyWire.begin(0x46);
TinyWire.onReceive(receiveEvent);
}
voidloop()
{
delay(1);
}
#endif
The text was updated successfully, but these errors were encountered:
oomek
changed the title
Two Attiny85s NACKing 5 out of 10 times on turning power on
Two Attiny85s NACKing 5 out of 10 times after turning the power on
Apr 25, 2020
I've been trying to link 2 Attiny85s, but the connection is very unreliable. When I connect the power for both boards at the same time I always get NACK, when I connect Slave first, wait until it boots ( 5 seconds Digispark Attiny85 ) I get communication half the time. I have 2k pull up resistors.
Here is the sketch I'm using:
The text was updated successfully, but these errors were encountered: