// thermo3_skel.c // R. Traylor // 11.15.2011 (revised 11.18.2013) //Demonstrates basic functionality of the LM73 temperature sensor //Uses the mega128 board and interrupt driven TWI. //PD0 is SCL, PD1 is SDA. #include #include #include #include #include #include "hd44780.h" #include "lm73_functions.h" #include "twi_master.h" char lcd_string_array[16]; //holds a string to refresh the LCD uint8_t i; //general purpose index extern uint8_t ................ extern uint8_t ................ //******************************************************************** // spi_init //Initalizes the SPI port on the mega128. Does not do any further // external device specific initalizations. //******************************************************************** void spi_init(void){ DDRB |= 0x07; //Turn on SS, MOSI, SCLK //mstr mode, sck=clk/2, cycle 1/2 phase, low polarity, MSB 1st, //no interrupts, enable SPI, clk low initially, rising edge sample SPCR=(1<