i have some trouble to use i2c and the other pins at the same time.
im tring to control the attiny over i2c with a arduino and the attiny should control a 28byj-48 stepmotor.
i started to setup the i2c connection pin 0 and pin 2 is use for that. it is working fine but then i connected the stepmotor driver on pin 1,3,4,5 after connecting the 5 pin i lose my i2c connection.
here is the code from the attiny, nothing special
#include <TinyWireS.h> // wrapper class for I2C slave routines
#define I2C_SLAVE_ADDR 0x29 // i2c slave address (38)
#define A 1
#define B 3
#define C 4
#define D 5
#define NUMBER_OF_STEPS_PER_REV 512
void setup(){
pinMode(1,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
TinyWireS.begin(I2C_SLAVE_ADDR); // init I2C Slave mode
}
void loop(){
byte byteRcvd = 0;
if (TinyWireS.available()){ // got I2C input!
byteRcvd = TinyWireS.receive(); // get the byte from master
//Blink(byteRcvd); // master must wait for this to finish before calling Wire.requestFrom
//byteRcvd += 10; // add 10 to what's received
//TinyWireS.send(byteRcvd); // send it back to master
// Blink(1); // show we transmitted
}
}