Trouble communicating the adafruit Trinket 5v with the MMA8452 Accelerometer

I am using the normal adafruit Trinket(5V) with the MMA8542 breakout board from Sparkfun. Because the trinket has an ATtiny chip inside it requires the TinyWire Library. Unfortunately I am unable to read data from the sensor.
The connections are the following:

  • #0-->330ohm-->SDA
  • #2-->330ohm-->SCL

The accelerometer is also powered by a regulated 3.3V source.
Here is the code that I adapted from one of the examples provided with the TinyWire.h library. I am not getting anything from the sensor. If anyone can help it would be greatly appreciated.

#define I2C_ADDR   0x1D // Edit if backpack A0/A1 jumpers set
 
#include <TinyWireM.h>
//#include <SFE_MMA8452Q.h>
#include <USI_TWI_Master.h>
int acc= 0;  
int led = 1; // blink 'digital' pin 1 - AKA the built in red LED
void setup() {
  // put your setup code here, to run once:
 
pinMode(led, OUTPUT);
TinyWireM.begin();   
}

void loop() {
  
  // put your main code here, to run repeatedly:
 Get_acc(); 
  if (acc!= 0) {
  digitalWrite(led,HIGH); //using the LED as a visual output
  }
}

void Get_acc(){  // Get the temperature from a DS1621
int acc;
  TinyWireM.beginTransmission(I2C_ADDR);
  TinyWireM.send(0xEE);                 // if one-shot, start conversions now
  TinyWireM.endTransmission();          // Send 1 byte to the slave
  delay(750);                           // if one-shot, must wait ~750 ms for conversion
  TinyWireM.beginTransmission(I2C_ADDR);
  TinyWireM.send(0xAA);                 // read temperature (for either mode)
  TinyWireM.endTransmission();          // Send 1 byte to the slave
  TinyWireM.requestFrom(I2C_ADDR,1); // Request 1 byte from slave
  acc = TinyWireM.receive();          // get the temperature
 
}

Right off the bat, I see an error in you code.

you define a variable:
int acc;
as a global variable (outer block) and then inside Get_acc() you define
a local variable with the same name, then at the end of Get_acc() you assign the
value received by the TinyWireM.receive() to the local variable. This value is lost when Get_acc() completes.

What I would do is change your Get_acc() from a VOID function to an int function

int Get_acc(){
//all of your existing code except the int acc; declaration
// delete acc = TinyWireM.receive();

// add add the following line as the last line of function

return TinyWireM.receive();
}

in the LOOP() function
acc = Get_acc();

I don't know your trinket device, but TWI transfers are single byte value (0..255)
defining acc as an int won't make it pass a larger value.

Does the Trinket actually return two bytes? An int value?
If so you would have to change the request to 2 and change the receive process.

// replace return TinyWireM.receive(); with the following
// if the data is send MSB LSB order
int acc;
acc = TinyWireM.receive();
acc = acc*256;
acc = acc + TinyWireM.receive();
return acc;

// if the data is send LSB MSB order
int acc;
acc = TinyWireM.receive();
acc = acc + (int)TinyWireM.receive()*256;
return acc;

Chuck.