proyecto para la realizacion de un altimetro con base ... - Tripoli Spain
proyecto para la realizacion de un altimetro con base ... - Tripoli Spain
proyecto para la realizacion de un altimetro con base ... - Tripoli Spain
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
{<br />
pinMo<strong>de</strong>(led, OUTPUT); // Pin 13 is output<br />
digitalWrite(led, LOW); // Initially turns the LED off by making the voltage LOW<br />
address = find_free_memory(); // Checks free memory (each measure uses 5 bytes,<br />
Wire.begin(); // Bus I2C<br />
bmp085Calibration();<br />
min_press = 200000;<br />
// so there is space for 100 measures)<br />
threshold = 0.999; // It is equivalent to 8.5m<br />
filter = 0.0016; // To prevent abnormal data gathered by the sensor that<br />
co<strong>un</strong>ter = 0;<br />
alpha = 0.2;<br />
// could trigger the stage change.<br />
// This value is equivalent to a speed = Mach 2, so<br />
// I assume rocket speed =500 ) p<strong>la</strong>y_buzzer_memory_full(); // P<strong>la</strong>y 7 low t<strong>un</strong>es if memory full<br />
else<br />
{<br />
}<br />
if (curr_stage < 3)<br />
{<br />
}<br />
read_altim();<br />
co<strong>un</strong>ter++;<br />
if (abs(pressure - prev_pressure) < filter * pressure)<br />
{<br />
}<br />
smooth_data();<br />
check_stage();<br />
else p<strong>la</strong>y_buzzer(); //only when reaching gro<strong>un</strong>d again<br />
void read_altim()<br />
{<br />
}<br />
temperature = bmp085GetTemperature(bmp085ReadUT());<br />
prev_pressure = pressure;<br />
pressure = bmp085GetPressure(bmp085ReadUP());<br />
// Stores all of the bmp085's calibration values into global variables<br />
// Calibration values are required to calcu<strong>la</strong>te temp and pressure<br />
20