No, your Mac doesn't have I2C support. It was pointed out in the comments that there might be some legacy port, but it won't be usable due to driver limitations.
You're getting a few things confused. USB is it's own technology, separate from I2C/UART/SPI. I'm not sure how you would even wire I2C to your Mac. The serial monitor in Arduino is for USB COM ports, not related to I2C.
As far as debugging, there's a few options. First of all, there are a few ways to debug I2C using an oscilloscope. If that's too expensive, you could also get away with a logic analyzer. The one I just linked was at Sparkfun for $150. If that's still too expensive and you're willing to risk $30, you can find cheap ones on eBay (most with little/no documenation).
I don't know your code, so I can't advise you on how to fix it. If you need to debug at such a low level, extra hardware is needed.
It doesn't seem like a maximum of 255 that odd, since that's the maximum number that you can do with one byte. You might have to split data up into multiple bytes with some sort of delimiter character. With some quick mental math, it seems as two bytes can give you numbers up to 65,535 if you combine both bytes (i.e. 10101010
+ 01010101
= 1010101001010101
).
Edit: this seems like the Arduino code you want:
#include <Wire.h>
#define SLAVE_ADDRESS 0x04
int number = 0;
int num1 = 0;
int num2 = 0;
int state = 0;
boolean secondByte = false;
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600); // start serial for output
// initialize i2c as slave
Wire.begin(SLAVE_ADDRESS);
// define callbacks for i2c communication
Wire.onReceive(receiveData);
Wire.onRequest(sendData);
Serial.println("Ready!");
}
void loop() {
delay(100);
}
// callback for received data
void receiveData(int byteCount){
while(Wire.available()) {
if(secondByte) {
num2 = Wire.read();
number = (num1 << 8) + num2;
Serial.print("data received: ");
Serial.println(number);
if (number == 1){
if (state == 0){
digitalWrite(13, HIGH); // set the LED on
state = 1;
}
else{
digitalWrite(13, LOW); // set the LED off
state = 0;
}
}
} else {
num1 = Wire.read();
}
secondByte != secondByte;
}
}
// callback for sending data
void sendData(){
Wire.write(num1);
Wire.write(num2);
}
The Python code will have to do the similar thing. Note: the first part of the number (reading left to right) will be sent first.