Skip to content

Instantly share code, notes, and snippets.

@mandyRae
mandyRae / bioinfo.py
Created May 11, 2016 18:48
code to parse and analyze nucleotide sequences and genetic mutations, bioinformatics research project
import data
#sequence = 'cgauggccuaaguuaaagcauccaagcguagauaauagugga'
'''
Functions defined here:
convertDNAtoRNA(sequence)
countNucleotides(sequence)
getLength(sequence)
sequenceIsValid(sequence)
@mandyRae
mandyRae / data.py
Created May 11, 2016 18:43
data for bioinformatics research on genes and proteins, goes with bioinfo.py
'''
Data file for bioinformatics research project
All of the following are genes were parsed for this project.
All are copied from NCBI's Nucleotide Database. Links are provided.
'''
'''GENES FROM CHROMOSOME 10 USED TO FIND CG CONTENT'''
#length 3618, http://www.ncbi.nlm.nih.gov/nuccore/XM_011539816.1
'''
Large Seven-Segment Display
Python Code for controlling display with a Raspberry Pi's GPIO
Written by Amanda on electrothoughts.wordpress.com, Aug 25, 2015
Modify this code to your heart's content!
This code contains function definitions. To make your display work,
it's recommended that you run the code in the Python shell IDE as root, and execute
functions from there, for example enter the following in a terminal:
@mandyRae
mandyRae / relaylight.ino
Last active April 2, 2016 20:41
ultrasonic sensor and power relay to control desk lighting
/*
Using an Arduino with a Power Relay
Parts used:
--ultrasonic sensor
--desk lamp
--Arduino Uno
--120v relay
@mandyRae
mandyRae / pi.py
Created March 15, 2016 12:26
Happy Pi Day!!!!
import time
j = 0
pi = 0
plusminus = True
start_time = time.time()
while True:
if j%2 == 1:
if plusminus == True:
pi += (1/j)
@mandyRae
mandyRae / tictac.py
Last active July 11, 2016 16:55
Raspberry Pi's GPIO pins with some LEDs and pushbuttons to make a tic tac toe arcade game; Python RPi.GPIO with PWM
'''
Tic Tac Toe -- Raspberry Pi GPIO -- v0.0
Amanda on Electrothoughts -- March 2016
--arcade game
--four-way keypad
--3x3 LED grid
--sound FX
--decent computer AI
--uses software PWM
@mandyRae
mandyRae / sonar.ino
Created February 14, 2016 01:48
Sample sketch for using ultrasonic sensors with Arduino
//This sketch demonstrates how to interface with ultrasonic sensors using the Arduino and NewPing library
#include <NewPing.h>
int TRIGGER = 12;
int ECHO = 11;
//Declare a sonar object specifying the trigger and echo pins
NewPing sonar(TRIGGER, ECHO);
@mandyRae
mandyRae / musicalbuzzer.py
Last active January 18, 2021 03:13
Allows you to encode basic melodies and play them on piezo buzzers or speakers on the Raspberry Pi, utilizing the GPIO.PWM class
'''
Order of the Raspberry -- Amanda, Josiah, and Xavier
Group Project -- Raspberry Pi 2015-2016
Melodies and Piezo Buzzers
See below for more details on the code.
Please use this code for whatever you want!! It can be improved in a lot of ways,
and can be used for many different circuit projects!
'''
@mandyRae
mandyRae / probability_dice_sim.py
Created February 9, 2016 17:11
Dice rolling simulation to compare the number experiemental trials vs theoretical probability
'''
Experimental Probability Dice Simulator
This program serves to demonstrate how experimental probability gives
way to theoretical probability as the number of trials increases, using rolls
of a perfect, standard, cube-shaped die. In effect, it demonstrates that the
probability of rolling any number on a perfect die is:
lim x = 1/6 = 0.1666...
x -> infty
@mandyRae
mandyRae / arduino_mouse_with_joystick.ino
Last active June 17, 2017 19:38
This is code to create a computer mouse using an analog joystick and computer mouse.
/*
* Analog Joystick Mouse Emulator with Arduino Micro
*
* This code turns a joystick into a computer mouse.
*
* Written by Amanda on Electrothoughts Jan 2016, with help from:
* - https://www.arduino.cc/en/Tutorial/JoystickMouseControl
* - book Exploring Arduino by Jeremy Blum: https://github.com/sciguy14/Exploring-Arduino/blob/master/Chapter%2006/mouse/mouse.ino
*
* For build instructions and background info visit www.electrothoughts.wordpress.com/2016/01/18/mouse-emulation-with-an-analog-joystick-and-arduino/