Posts

Showing posts from September, 2017

Day 6

Image
For homework we had to make a program  that computes the great circle distance between two points in the Northern Hemisphere. Here is the program that calculates the angle between two vectors Here is the code for the distance and angle between two points, I could get the added North and South function added but could not get the West and East one to work For lab we had to use the  PIR and CdS sensors to control the LED. Here is the light sensor working with the LED and this link  shows the LED in action I tried to get the PIR lab to work but couldn't get the sensor to work I could only get the light to turn off when i disconected the PIR.

Day 5

Image
For the lab i had to write a program that causes an LED to change color depending on the temperature Here's the code //Potentiometer Reading Program const int POT=0; //Pot on analog pin 0 int val = 0; //variable to hold the analog reading from the POT const int BLED=9; //Blue LED on Pin 9 const int GLED=10; //Green LED on Pin 10 const int RLED=11; //Red LED on Pin 11 int ledMode = 0; //Cycle between LED states void setup() {  Serial.begin(9600); //Start Serial Communication  pinMode (BLED, OUTPUT); //Set Blue LED as Output  pinMode (GLED, OUTPUT); //Set Green LED as Output  pinMode (RLED, OUTPUT); //Set Red LED as Output } void loop() {  val = analogRead(POT); //Read one value from the POT  if (val <= 139)  { digitalWrite(BLED,HIGH); digitalWrite(GLED,LOW); digitalWrite(RLED,LOW);  } if (val<=147 && val>=139) {   digitalWrite(GLED,HIGH);   digitalWrite(BLED,LOW);   digitalWrite(RLED,...

Day 4

For homework i had to create an RGB LED that changes color depending on what button is pressed here is my code const int BLED=9; //Blue LED on Pin 9 const int GLED=10; //Green LED on Pin 10 const int RLED=11; //Red LED on Pin 11 const int BUTTON=2; //The Button is connected to pin 2 const int XBUTTON=3; const int YBUTTON=5; boolean lastButton = LOW; //Last Button State boolean currentButton = LOW; //Current Button State boolean XlastButton=LOW; boolean XcurrentButton=LOW; boolean YlastButton=LOW; boolean YcurrentButton=LOW; int ledMode = 0; //Cycle between LED states int XledMode=0; int YledMode=0; void setup() {  pinMode (BLED, OUTPUT); //Set Blue LED as Output  pinMode (GLED, OUTPUT); //Set Green LED as Output  pinMode (RLED, OUTPUT); //Set Red LED as Output  pinMode (BUTTON, INPUT); //Set button as input (not required)  pinMode (XBUTTON, INPUT);  pinMode (YBUTTON, INPUT); } boolean debounce(boolean last) {  boole...

Day 3

Image
Here is the code for the salinity program, that finds new freezing temp Here is the code for the salinity program, that finds new salinity level Here is the code that prints out the speed in ft/s and ft/^2 for the Jet assignment And here are the log programs  Here's for log 2 Here's for log 8 This is LAB 3 where we had to have two blinking LEDS with buttons Here's a screencap of my code and here's a  link  to the arduino in action.

Day 2

Image
For this homework assignment we had to create a program that prints the molecular weight for  amino acids For glutamine and glutamic For glyceme   Asks user to enter number of atoms for amino acid and then prints amino acid weight Asks user to enter number of atoms for amino acid and then prints amino acid average weight This is the anthropology hw The program reads  femur and humerus length in inches and prints out the height in feet and inches LAB 1 For our first lab we had to make a a couple leds light up in sequence  like the kit car here's a screencap of the code and a  link  to the arduino working