Skip to content

Instantly share code, notes, and snippets.

volatile char *ptr = NULL; // pointer to datastring buffer
volatile boolean sentence_needed = true;
char send_datastring[100] = "";
#define DOMINOEX // enable dominoex instead of RTTY
unsigned char varicode[][3] = {
/* Primary alphabet */
{ 1,15, 9}, { 1,15,10}, { 1,15,11}, { 1,15,12}, { 1,15,13}, { 1,15,14}, { 1,15,15}, { 2, 8, 8},
{ 2,12, 0}, { 2, 8, 9}, { 2, 8,10}, { 2, 8,11}, { 2, 8,12}, { 2,13, 0}, { 2, 8,13}, { 2, 8,14},
void loop(){
// continuously updating individual telemetry fields
if (sentence_needed == true){
sprintf(buffer, "%s, %d, %s .. ", callsign, sentence_id, latitude ..); // store all telemetry in buffer
*ptr = buffer; // set data at location being pointed to, to the buffer
}
}
// note, rtty_txbit() function will be replaced by directly operating pins, just using to save space for now
current_byte = "E";
ISR(TIMER1_COMPA_vect)
{
if (current_bit_count == 0){ // if we're about to send a new byte...
rtty_txbit(0); // tx a start bit
}
// timer ISR to interrupt main program at intervals specific to 50 baud RTTY
ISR(TIMER1_COMPA_vect)
{
if (strlen(datastring) > 0){ //if there are characters still to be sent...
next_bit = datastring[0]; //get first character in datastring char array
rtty_txbyte(next_bit); //transmit character over radio
#calcuate expected UBX ACK packet and parse UBX response from GPS
def getUBX_ACK(MSG):
b = 0
ackByteID = 0
ackPacket = [0 for x in range(10)]
startTime = millis()
print "Reading ACK response: "
#!/usr/bin/python
# for SSDV, see gist here (https://gist.github.com/ibanezmatt13/5694404)
import RPi.GPIO as GPIO
import os
import serial
import crcmod
import time
import time as time_ # look to change this
$GPGGA,,,,,,0,00,,,,,,,*66
$GPGSA,,,,,,*42
$GPRMC,000043,V,5238.6713,N,00030.1533,W,0.000,0.0,290697,4.1,W*68
$PRWIZCH,19,0,19,0,19,0,19,0,19,0,19,0,19,0,19,0,19,0,19,0,19,0,19,0*4D
$GPGGA,,,,,,0,00,,,,,,,*66
$GPGSA,,,,,,*42
$GPRMC,000044,V,5238.6713,N,00030.1533,W,0.000,0.0,290697,4.1,W*6F
$PRWIZCH,19,0,19,0,19,0,19,0,19,0,19,0,19,0,19,0,19,0,19,0,19,0,19,0*4D
$GPGGA,,,,,,0,00,,,,,,,*66
$GPGSA,,,,,,*42
import numpy
import matplotlib.pyplot as plt
import sys
g = 9.81 # m/s^2
time_step = 0.01 # s
parachute_cd = 0.9
parachute_area = 0.26
import numpy
import matplotlib.pyplot
g = 9.81 # m/s^2
time_step = 0.1 # s
deployed = False
peak_time = 0
deployment_time = 0
ejection_delay = 0
timer = 0
motor_thrust = [10,20,33.5,45.55,30.55,20.12,9.776,2.22] # array of motor thrust values in newtons at different times
motor_times = [0.049, 0.097, 0.153, 0.264, 0.335, 0.469, 0.555, 0.746] # array of times at which the above thrusts occur
time_step = 0.01 # common time step
min_thrust = 0
max_thrust = 0
current_time = 0
# function to find min and max thrust based on current time and calculate estimated thrust value based on that
def estimate_thrust(current_time):