Skip to content

Instantly share code, notes, and snippets.

# import libraries
import time
import os
while True: # do forever
os.system('fswebcam -r 320x240 -S 3 --jpeg 50 --save /home/pi/to_transmit/%H%M%S.jpg') # uses Fswebcam to take picture
import os
import time
import os.path
import serial
def process_image():
best_file = ""
biggest_size = 0
<daveake> Our postman has a second job as an electrical system tester
[10:00] <daveake> (you can do your own punchline)
[10:00] <daveake> perhaps you can't ... :p
[10:01] <ibanezmatt13> I'm sorry, I don't have a punchline :)
[10:01] <daveake> postman PAT
[10:01] <fsphil> oh dear
[10:01] <ibanezmatt13> oh god
[10:01] <ibanezmatt13> :)
[10:01] <daveake> worth the wait, no?
[10:01] <HixWork> too early for that lark
[16:23] <daveake> I shall explain how it works ...
[16:24] <ibanezmatt13_> thanks
[16:24] <daveake> ... by getting you to figure it out :-)
[16:24] <ibanezmatt13_> sure :)
[16:24] <daveake> So, the CPU pin (Tx on the Pi) is set to low or high
[16:25] <daveake> low is 0V so that's GND, and high is 3.3V so that's Vcc
[16:25] <ibanezmatt13_> ok, i'm with you so far
[16:25] <daveake> Good
[16:25] <daveake> So that goes through a resistor let's say it's 30k
[16:25] <ibanezmatt13_> yep
# import required libraries
import serial
import crcmod
import os
import os.path
import time
GPS = serial.Serial('/dev/ttyAMA0', 9600) # open serial to write to GPS
# Disabling all NMEA sentences except $GPGGA
@ibanezmatt13
ibanezmatt13 / MATT-1.py
Last active May 16, 2018 18:43
This is a Python program for my first HAB (high-altitude balloon) flight. The flight will go ahead with the callsign "MATT-1" as it's my first launch and my name's Matt :) The program is split into three functions. There is a function to read the GPS and process the data receiver; a function to convert the returned position data into decimal lat…
#!/usr/bin/python
# import required libraries
import serial
import crcmod
import time
import time as time_
gps_set_sucess = False # boolean for the status of flightmode
# import required libraries
import serial
import crcmod
import os
import os.path
import time
def disable_sentences():
GPS = serial.Serial('/dev/ttyAMA0', 9600, timeout=1) # open serial to write to GPS
[10:11] <ibanezmatt13> I mean it's working perfectly with it in, but I just wanted to know if it would harm the ublox
[10:14] <daveake> no not at all
[10:15] <ibanezmatt13> excellent. My program is now utterly bombproog
[10:15] <ibanezmatt13> bombproof :)
[10:15] == marcosscriven [[email protected]] has quit [Remote host closed the connection]
[10:15] <ibanezmatt13> I've reset the GPS while it's been running, taken out the TX line, the RX line, everything. And it still works :)
[10:15] <daveake> A bold statement; you'll soon learn not to make those :)
[10:16] <daveake> Seriously though well done
[10:17] <Upu> lol
[10:17] <ibanezmatt13> thanks :)
!/bin/sh -e # i commented this out
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
#!/bin/bash
while [ 1 ]; do # forever
{
/home/pi/MATT-1.py;
SLEEP(5)
}
done