# HG changeset patch # User kripperger@CL-SEC241-09.cedarville.edu # Date 2013-02-14 15:31:31 # Node ID 6fe1c15f94583828419dbe6525c8a8032d728b06 # Parent 82502877a2188a345a9625167946192b8eac681f Fixes for sensors diff --git a/slave/slave/lib/sensors.c b/slave/slave/lib/sensors.c --- a/slave/slave/lib/sensors.c +++ b/slave/slave/lib/sensors.c @@ -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() diff --git a/slave/slave/slave.c b/slave/slave/slave.c --- a/slave/slave/slave.c +++ b/slave/slave/slave.c @@ -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);