Changeset - 985cf9d20832
[Not reviewed]
default
0 3 0
kripperger@CL-SEC241-09.cedarville.edu - 12 years ago 2013-04-12 21:21:04
kripperger@CL-SEC241-09.cedarville.edu
Fixing Altitude and enableing 2 step identification for daughterboards
3 files changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
slave/slave/lib/inputOutput.c
Show inline comments
 
@@ -43,10 +43,10 @@ int8_t	moduleID;	// Slave Module ID from
 
 void io_readModuleId()
 
 {
 
	// Get ID from rotary dip and return it. 
 
	moduleID = 2;
 
	moduleID = 0;
 
	
 
	/*
 
	// This method is temporary as the next release will read the module ID from EEPROM
 
	
 
	// First read ID from rotary encoder
 
	PORTC |= (1 << PC2);	// Pull pins on rotary dip high
 
	PORTC |= (1 << PC3);	// Pull pins on rotary dip high
 
	PORTC |= (1 << PC4);	// Pull pins on rotary dip high
 
@@ -55,9 +55,9 @@ int8_t	moduleID;	// Slave Module ID from
 
	moduleID = ((PINC & 0b00011100) >> 2);		// Read Dip Encoder
 
	moduleID = ~moduleID;						//Invert Dip reading
 
	moduleID = (moduleID & 0b0111);				//Mask bits
 
	*/
 
 
	while(moduleID==0)           //UNCOMMENT ALL THIS
 
	
 
	// If rotary encoder was 0, read ID from EEPROM
 
	while(moduleID==0)           
 
	{
 
		moduleID = i2c_read(EEPROM_ADDR, 0x05);
 
	}
slave/slave/lib/sensors.c
Show inline comments
 
@@ -186,10 +186,10 @@ void sensors_readPressure()
 
	x1 = (x1 * 3038) >> 16;
 
	x2 = (-7357 * pressure) >> 16;
 
	pressure += (x1 + x2 + 3791) >> 4;				//This is the final value for our pressure
 
	pressure = pressure - 20750;	// Linear Offset for actual pressure
 
	pressure = pressure;	// Linear Offset for actual pressure
 
	
 
	altitude = (float)44330 * (1 - pow(((float) pressure/105225), 0.190295));	// 101325 THIS IS IN METERS
 
	altitude = altitude * 3.2804;	//THIS IS IN FEET
 
	altitude = (float)44330 * (1 - pow(((float) pressure/101325), 0.190295));	// 101325 THIS IS IN METERS
 
	altitude = (float)altitude * 3.2804;	//THIS IS IN FEET
 
}
 
 
void sensors_readHumid()
slave/slave/modules.c
Show inline comments
 
@@ -137,7 +137,7 @@
 
	sensors_readSpiTemp();			//Data Read	
 
	sensors_readPressure();			//Data Read
 
	//sensors_readHumid();			//Data Read
 
	//sensors_readLux();				//Data Read
 
	sensors_readLux();				//Data Read
 
	 
 
 }
 
  
0 comments (0 inline, 0 general)