Merge pull request #80 from alanbjohnston/bp-gps

Bp gps
bp
alanbjohnston 5 years ago committed by GitHub
commit af1e5885ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -139,7 +139,7 @@ int sampleTime = 0, frames_sent = 0;
int cw_id = ON; int cw_id = ON;
int vB4 = FALSE, vB5 = FALSE, vB3 = FALSE, ax5043 = FALSE, transmit = FALSE, onLed, onLedOn, onLedOff, txLed, txLedOn, txLedOff, payload = OFF; int vB4 = FALSE, vB5 = FALSE, vB3 = FALSE, ax5043 = FALSE, transmit = FALSE, onLed, onLedOn, onLedOff, txLed, txLedOn, txLedOff, payload = OFF;
float batteryThreshold = 3.0, batteryVoltage; float batteryThreshold = 3.0, batteryVoltage;
float latitude = 39.027702f, longitude = -77.078064f; // 100x for now float latitude = 40.0373f, longitude = -75.3491f; // 100x for now
float lat_file, long_file; float lat_file, long_file;
float axis[3], angle[3], volts_max[3], amps_max[3], batt, speed, period, tempS, temp_max, temp_min, eclipse; float axis[3], angle[3], volts_max[3], amps_max[3], batt, speed, period, tempS, temp_max, temp_min, eclipse;
@ -215,7 +215,11 @@ mode = AFSK;
latitude = toAprsFormat(lat_file); latitude = toAprsFormat(lat_file);
longitude = toAprsFormat(long_file); longitude = toAprsFormat(long_file);
printf("Lat/Long in APRS DDMM.MM format: %f/%f\n", latitude, longitude); printf("Lat/Long in APRS DDMM.MM format: %f/%f\n", latitude, longitude);
} else { // set default
latitude = toAprsFormat(latitude);
longitude = toAprsFormat(longitude);
} }
wiringPiSetup(); wiringPiSetup();
// Check for SPI and AX-5043 Digital Transceiver Board // Check for SPI and AX-5043 Digital Transceiver Board
@ -999,7 +1003,7 @@ void get_tlm(void) {
#ifdef DEBUG_LOGGING #ifdef DEBUG_LOGGING
printf("Tx LED Off\n"); printf("Tx LED Off\n");
#endif #endif
sleep(3); sleep(30);
digitalWrite(txLed, txLedOn); digitalWrite(txLed, txLedOn);
#ifdef DEBUG_LOGGING #ifdef DEBUG_LOGGING
printf("Tx LED On\n"); printf("Tx LED On\n");
@ -2004,7 +2008,7 @@ int test_i2c_bus(int bus)
} }
float toAprsFormat(float input) { float toAprsFormat(float input) {
// converts decimal coordinate (lattitude or longitude) to APRS DDMM.MM format // converts decimal coordinate (latitude or longitude) to APRS DDMM.MM format
int dd = (int) input; int dd = (int) input;
int mm1 = (int)((input - dd) * 60.0); int mm1 = (int)((input - dd) * 60.0);
int mm2 = (int)((input - dd - (float)mm1/60.0) * 60.0 * 60.0); int mm2 = (int)((input - dd - (float)mm1/60.0) * 60.0 * 60.0);

@ -46,7 +46,7 @@ void setup() {
Serial.println("Could not find a valid BME280 sensor, check wiring!"); Serial.println("Could not find a valid BME280 sensor, check wiring!");
bmePresent = 0; bmePresent = 0;
} }
/*
mpu6050.begin(); mpu6050.begin();
if (eeprom_word_read(0) == 0xA07) if (eeprom_word_read(0) == 0xA07)
@ -79,7 +79,6 @@ void setup() {
Serial.println(((float)eeprom_word_read(2)) / 100.0, DEC); Serial.println(((float)eeprom_word_read(2)) / 100.0, DEC);
Serial.println(((float)eeprom_word_read(3)) / 100.0, DEC); Serial.println(((float)eeprom_word_read(3)) / 100.0, DEC);
} }
*/
} }
void loop() { void loop() {
@ -110,7 +109,7 @@ void loop() {
{ {
Serial.print("OK BME280 0.0 0.0 0.0 0.0"); Serial.print("OK BME280 0.0 0.0 0.0 0.0");
} }
// mpu6050.update(); mpu6050.update();
Serial.print(" MPU6050 "); Serial.print(" MPU6050 ");
Serial.print(mpu6050.getGyroX()); Serial.print(mpu6050.getGyroX());
@ -202,7 +201,7 @@ void loop() {
{ {
Serial1.print("OK BME280 0.0 0.0 0.0 0.0"); Serial1.print("OK BME280 0.0 0.0 0.0 0.0");
} }
// mpu6050.update(); mpu6050.update();
Serial1.print(" MPU6050 "); Serial1.print(" MPU6050 ");
Serial1.print(mpu6050.getGyroX()); Serial1.print(mpu6050.getGyroX());

Loading…
Cancel
Save

Powered by TurnKey Linux.