Skip to content

Instantly share code, notes, and snippets.

Mapping Astro Pi Life on Earth Images

A simple way to visualise the path of the ISS while your experiment was running is to plot your photos on a map. You can use a free software application on the Raspberry Pi to do this easily and quickly.

Note: In order for this to work, you should have embedded into the EXIF meta-data of your photo the latitiude and longitude of the ISS at the time the image was captured (this process was described in this section of the Phase 2 guide).

If you saved your latitude/longitude into a CSV file but did not embed the data into the appropriate EXIF fields then you could write some code to do this now.

Installation

@topshed
topshed / Arduino - sound detection.md
Last active May 9, 2019 11:42
Arduino - sound detection

Imgur

const int sensorPin = A0; 
int sensorValue = 0;

void setup() {
  Serial.begin(9600);
  pinMode(sensorPin, INPUT); 
}

Find folders without main.py files

 find Izzy -mindepth 1 -maxdepth 1 -type d '!' -exec test -e "{}/main.py" ';' -print
@topshed
topshed / pir_example.md
Last active January 11, 2022 08:49
PIR example

Reading the value attribute from a gpiozero MotionSensor

This example shows how to use the .value attribute. Note that it is not a function and so does not use paranethseses. Here pir.value is treated in the same way as you would a variable.

from gpiozero import MotionSensor
from time import sleep

pir = MotionSensor(12)
@topshed
topshed / dogcat.py
Created October 12, 2022 10:49
MZ 2022/23 animation eexample
# m8tricks output file
from sense_hat import SenseHat
from time import sleep
sh = SenseHat()
sh.rotation = 270
sh.clear(0,0,0)
g = (0,255,0)
y = (255,255,0)
b = (0,0,0)
p = (255,0,255)
@topshed
topshed / pumpkin_sh.py
Created November 2, 2022 13:37
pumpkin
# Import the libraries
from sense_hat import SenseHat
from time import sleep
# Set up the Sense HAT
sense = SenseHat()
sense.set_rotation(270, False)
# Set up the colour sensor
sense.color.gain = 60 # Set the sensitivity of the sensor
@topshed
topshed / LEGO Spike Prime for CoderDojo: Quick start
Last active April 15, 2024 15:10
LEGO Spike Prime for CoderDojo: Quick start
Start by building your robot.
The simplest robot is the Spike hub connected to two wheels and a caster
There are lots of ways to build a similar 2-wheeled bit, and the design shown here might not be the best for every task.
You may also need to adapt your code if you build a bot with larger motors or wheels.
@topshed
topshed / Using the distance sensor
Last active April 15, 2024 15:14
LEGO Spike Prime snippets for CoderDojo