Changeset - 6fe1c15f9458
[Not reviewed]
default
0 2 0
kripperger@CL-SEC241-09.cedarville.edu - 12 years ago 2013-02-14 15:31:31
kripperger@CL-SEC241-09.cedarville.edu
Fixes for sensors
2 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
slave/slave/lib/sensors.c
Show inline comments
 
@@ -182,8 +182,8 @@ void sensors_readPressure()
 
	x2 = (-7357 * pressure) >> 16;
 
	pressure += (x1 + x2 + 3791) >> 4;				//This is the final value for our pressure
 
	
 
	altitude = 44330 * (1 - pow((pressure / 101325), (1 / 5.255)));
 
	//altitude = (float)44330 * (1 - pow(((float) pressure/101325), 0.190295));
 
	//altitude = 44330 * (1 - pow((pressure / 101325), (1 / 5.255)));
 
	altitude = (float)44330 * (1 - pow(((float) pressure/101325), 0.190295));
 
}
 
 
void sensors_readHumid()
slave/slave/slave.c
Show inline comments
 
@@ -62,7 +62,7 @@ int main(void)
 
	
 
	
 
	// Serial output //DEBUG
 
	char buff[64];							//Buffer for serial output //DEBUG
 
	char buff[128];							//Buffer for serial output //DEBUG
 
	serial0_sendString("Starting Slave\r\n");
 
			
 
    while(1)
 
@@ -82,8 +82,8 @@ int main(void)
 
			
 
			io_regulateTemp();			// Gets board temperature and enables heater if below threshold
 

	
 
			snprintf(buff,128,"|ModuleID: %u |BoardTemp: %i |Millis: %lu |Light: %u |Pressure: %u \r\n",io_getModuleId(),sensors_getBoardTemp(),time_millis(),sensors_getLight(),sensors_getPressure()); //DEBUG
 
			serial0_sendString(buff); //DEBUG
 
			//snprintf(buff,128,"|ModuleID: %u |BoardTemp: %i |Millis: %lu |Light: %u |Pressure: %lu |Altitude: %lu \r\n",io_getModuleId(),sensors_getBoardTemp(),time_millis(),sensors_getLight(),sensors_getPressure(),sensors_getAltitude()); //DEBUG
 
			//serial0_sendString(buff); //DEBUG
 

	
 
			_delay_ms(2);		// Delay to prevent the sensor loop from running again before time_millis changes
 
			led_off(0);
0 comments (0 inline, 0 general)