This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Measures the speed of a ping pong ball using the distance | |
between two photoresistors and millis() */ | |
int sensor1Value; | |
int sensor2Value; | |
double startTime; | |
double endTime; | |
double time; | |
double timeInSeconds; | |
double distance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Read .wav file | |
[recording,Fs] = audioread('recording.wav'); | |
time = (1/Fs)*length(recording); | |
t = linspace(0, time, length(recording)); | |
% Plots recording | |
normalplot = figure; | |
plot(t,recording); | |
xlabel('Time (seconds)'); | |
ylabel('Amplitude'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InvalidLengthException extends Exception | |
{ | |
private String lengthSent; | |
//Creates a blank InvalidLengthException with no arguements. | |
private InvalidLengthException() | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.ObjectInputStream; | |
import java.io.ObjectOutputStream; | |
import java.util.Scanner; | |
public class Blackjack { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.EventQueue; | |
public class Driver { | |
/** | |
* Launch the application. | |
*/ | |
public static void main(String[] args) { | |
EventQueue.invokeLater(new Runnable() { | |
public void run() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Measures the speed of a ping pong ball using the distance | |
between two photoresistors and millis() */ | |
int sensor1Value; | |
int sensor2Value; | |
double startTime; | |
double endTime; | |
double time; | |
double timeInSeconds; | |
double distance; |