Changeset - 460153f9c03f
[Not reviewed]
default
0 2 0
mkroening@CL-ENS241-07.cedarville.edu - 12 years ago 2013-02-25 17:01:44
mkroening@CL-ENS241-07.cedarville.edu
EEPROM attempt 1
2 files changed with 10 insertions and 6 deletions:
0 comments (0 inline, 0 general)
slave/slave/lib/inputOutput.c
Show inline comments
 
@@ -40,11 +40,7 @@ int8_t	moduleID;	// Slave Module ID from
 
	
 
 }
 
 
 
 
 
 
   
 
 
 
 
 
  
 
 void io_readModuleId()
 
 {
 
	// Get ID from rotary dip and return it. 
 
@@ -64,9 +60,10 @@ int8_t	moduleID;	// Slave Module ID from
 
/*
 
	while(moduleID==0)
 
	{
 
		moduleID = i2c_read(EEPROM_ADDR, 0x04);
 
		moduleID = i2c_read(EEPROM_ADDR, 0x05);
 
	}
 
*/
 
 //moduleID = i2c_read(EEPROM_ADDR, 0x05);
 
 
 
 }
slave/slave/slave.c
Show inline comments
 
@@ -45,6 +45,10 @@ void micro_setup()
 

	
 
int main(void)
 
{
 
	// Writes ID to EEPROM, change for all modules and delete after programming
 
	// 0 is for generic setup, 1 is for sensors, 2 is for Geiger, 3 is for cameras
 

	
 
		
 
	// Initialize		
 
	micro_setup();			// Generic microcontroller config options
 
	time_setup();			// Setup loop timer and interrupts (TIMER0)
 
@@ -77,6 +81,8 @@ int main(void)
 
			sensors_readBoardTemp();		// Read board temperature sensor (Common on all slaves) (Data Read)
 
			modules_run(io_getModuleId());	// Runs specific module functions (like data reading)
 
			
 
			i2c_write(EEPROM_ADDR, 0x05, 0x01);
 
			
 
			io_regulateTemp();			// Gets board temperature and enables heater if below threshold
 

	
 
			//snprintf(buff,128,"|ModuleID: %u |BoardTemp: %i |Millis: %lu |Lux: %lu |Pressure: %lu |Altitude: %lu |Battery: %u \r\n ",io_getModuleId(),sensors_getBoardTemp(),time_millis(),sensors_getLux(),sensors_getPressure(),sensors_getAltitude(),sensors_getBatt()); //DEBUG
 
@@ -85,6 +91,7 @@ int main(void)
 
			_delay_ms(1);		// Delay to prevent the sensor loop from running again before time_millis changes
 
			led_off(0);
 
			led_off(2);
 
			led_output(i2c_read(EEPROM_ADDR, 0x05));
 
		}
 

	
 
    }
0 comments (0 inline, 0 general)