#include #include #include #include //#include "uart.h" //FILE uart_str = FDEV_SETUP_STREAM(uart_putchar, uart_getchar, _FDEV_SETUP_RW); char transmit_flag; char local_status; char remote_status; void SPIInit(); char txSPI(char data); char rxSPI(); #define switches() ~PINA #define setLEDs(x) PORTD = x int main() { SPIInit(); while(1){ // Read in the local switches, for transmission. local_status = switches(); remote_status = txSPI(0x00); setLEDs(~remote_status); // fprintf(stdout,"Remote: 0x%0X \n\r", remote_status); _delay_ms(10); } } void SPIInit() { // Initialize the UART // uart_init(); stdout = &uart_str; // _delay_us(100); // fprintf(stdout,"Starting SPI test: MASTER"); // make the MOS20I, SCK, and SS pins outputs DDRB |= (1<