#define SDA PDR1.BITS.B0 #define SCL PDR1.BITS.B1 void SendSerially(char Value) { char BitCount; // Start with the clock low SCL = 0; for (BitCount = 0 ; BitCount < 8 ; BitCount++) { // Place the least significant bit on the SDA pin SDA = (Value & 0x01); // Toggle the clock line high then low SCL = 1; SCL = 0; // Shift the value down so the next bit to send is in the bit 0 position. Value >>= 1; } }