/* Standard Include for 16F877 Chip */
#include <16F877.h>
#fuses XT,NOWDT,NOPROTECT,NOLVP,PUT

/* Delay for 4 mhz crystal */
#use delay (clock=4000000)

/* Setup RS232 */
#use rs232(baud=9600, xmit=PIN_D4,rcv=PIN_D5, INVERT)

/* Setup I2C */
#use I2C(MASTER, sda=PIN_C4, scl=PIN_C3, SLOW)

main()
{
   int8 i2c_command = 66;

   while (true)
   {
      delay_ms(1000);
      printf("Outputting: %c", i2c_command);
      
      /* Master */
      i2c_start();		// Start condition
      i2c_write(0xa0);	// Device address
      i2c_write(i2c_command);	// Write Command
      i2c_stop();		// Stop condition

   }
}



