diff --git a/slave/slave/config.h b/slave/slave/config.h --- a/slave/slave/config.h +++ b/slave/slave/config.h @@ -15,11 +15,8 @@ //I2C Addresses #define BOARDTEMP_ADDR 0xA5 //THIS VALUE IS WRONG - #define PRESSURE_ADDR 0xA1 //THIS VALUE IS WRONG - #define HUMID_ADDR 0xA4 //THIS VALUE IS WRONG - #define RTC_ADDR 0xA2 //DEBUG //read A3 - write A2 diff --git a/slave/slave/modules.c b/slave/slave/modules.c new file mode 100644 --- /dev/null +++ b/slave/slave/modules.c @@ -0,0 +1,9 @@ +/* + * modules.c + * + * Created: 11/9/2012 11:44:22 AM + * Author: kripperger + */ + + #include + #include "modules.h" \ No newline at end of file diff --git a/slave/slave/modules.h b/slave/slave/modules.h new file mode 100644 --- /dev/null +++ b/slave/slave/modules.h @@ -0,0 +1,16 @@ +/* + * modules.h + * + * Created: 11/9/2012 11:44:36 AM + * Author: kripperger + */ + + +#ifndef MODULES_H_ +#define MODULES_H_ + + + + + +#endif /* MODULES_H_ */ \ No newline at end of file diff --git a/slave/slave/slave.c b/slave/slave/slave.c --- a/slave/slave/slave.c +++ b/slave/slave/slave.c @@ -12,13 +12,14 @@ #include "config.h" +#include "modules.h" #include #include #include #include -//#include "lib/serial.h" +//#include "lib/serial.h" //Not made yet #include "lib/led.h" #include "lib/inputOutput.h" #include "lib/i2c.h" @@ -27,7 +28,9 @@ void micro_setup() { // Generic microcontroller config options + DDRA=0xFF; //PORTA is output //DEBUG + } @@ -39,6 +42,7 @@ int main(void) led_configure(); // i2c_init(); // Setup I2C //serial_setup(); // Config serial ports + uint8_t moduleID = io_getModuleId(); // Slave Module ID from rotary dip switch @@ -52,18 +56,34 @@ int main(void) //serial_SendCommand('0','A',0,0); //DEBUG: EXAMPLE - - //i2c_write(RTC_ADDR, 0x05, 0x3A); //DEBUG: EXAMPLE _delay_ms(10); - temp = i2c_read(RTC_ADDR, 0x02); //DEBUG: EXAMPLE: seconds - //_delay_ms(10); - - //PORTA = temp; - PORTA = 0xFF; + PORTA = temp; + + + switch(moduleID) + { + case 0: + break; + + case 1: + break; + + case 2: + break; + + case 3: + break; + + default: + break; + } + + + } return 0; diff --git a/slave/slave/slave.cproj b/slave/slave/slave.cproj --- a/slave/slave/slave.cproj +++ b/slave/slave/slave.cproj @@ -132,6 +132,12 @@ compile + + compile + + + compile + compile