Wednesday, December 2, 2015

Measuring the Light (Luminosity)

In this challenge we had to have to get a special chip that didn’t come in the Sunfounder kit, but we do have on hand. We then clicked this link http://adafru.it/d7d to install the AdaFruit Library. After that we had to unzip it, copy the Folder and then find the Arduino library on our hard drive and paste it into the Library Folder there. We also needed the Adafruit Sensor Library.When completed we downloaded the Adafruit_Sensor Library then copied and pasted the folder into our Aquino's library folder like you did above. When completed we restarted the Arduino IDE. Now we could run the File->Examples->Adafruit_TSL2561->sensorapi example program which read and calculate the lux readings for us. Lastly we took a look at the program. To see the readings Ruth and I had clicked on the little magnifying glass at the top of the Arduino window to open the Serial Monitor. We then used code
{  
 sensors_event_t event;
 tsl.getEvent(&event);
 if (event.light)
 {
   Serial.print(event.light); Serial.println(" lux");
 }
 else
 {
      Serial.println("Sensor overload");
 }
 delay(250);

}

This code was recursive and just keeps calling itself over and over
The last code being used was:
Serial.print(event.light);

which prints out the luminosity value.

Monday, November 30, 2015

Wiring the RGB Bulb

For this post, we had to do something completely different compared to the last post "Writing Your Name". Our objective was to make different colors by using red, blue, and green wires that would change the color of the RGB bulb. To begin, we gathered all our materials. We used the Arduino Board, 3 different colored wires, 3 receptors, bread board and the RGB bulb. The RGB blub was completely different compared to the LED light.It had the ability to light up a certain color depending on what wire was plugged in. We then being mixing the colors. When we mix, blue and red, the RGB bulb turned purple. When the green and blue were mixed, it was more of a bluish color. When we finally mixed all 3 colors, it was a purple bluish color. 


This is the code used below: int redpin=9;      //Pin 9


int greenpin=10;    //Pin 10
int bluepin=11;      //Pin 11
int var=0;
int var1=0;

void setup()
{
}

void loop()
{
  
   analogWrite(redpin,0);    //GREEN
   analogWrite(greenpin,255);
   delay(5000);


   analogWrite(greenpin,0);    //GREEN
   analogWrite(bluepin,255);
   delay(5000);
 analogWrite(bluepin,0);    //GREEN
   analogWrite(redpin,255);
   del

Writing Your Name

For this post, our task was to have our name appear with a 7 segment display. A seven-segment is a electronic piece used to display numbers. To make this happen, we had to use certain materials. We used the bread board, LED lights, about 5 receptors and a SSD. Then, we kept the top part of the program the same. After you begin the loop part. For the loop part, we then entered the a code. A R for Ruth and a N for Nelson then appeared. We not only had the ability to flash our names, but we could turn them off right after.

This was the code used below:

void loop() {
 digitalWrite(ledB, HIGH);     // draw a R
 digitalWrite(ledC, HIGH);
 digitalWrite(ledD, HIGH);


 delay(2000);                 // wait for 2 second
 
 digitalWrite(ledB, LOW);   
 digitalWrite(ledC, LOW);
 digitalWrite(ledD, LOW);   // turn off R
 
 digitalWrite(ledE, HIGH);   
 digitalWrite(ledF, HIGH);     // turn on N
 digitalWrite(ledA, HIGH);
 digitalWrite(ledB, HIGH);   
 digitalWrite(ledC, HIGH);
 digitalWrite(ledG, HIGH);
 delay(2000);  
 
 digitalWrite(ledE, LOW);   
 digitalWrite(ledF, LOW);
 digitalWrite(ledA, LOW);     turn off N
 digitalWrite(ledB, LOW);   
 digitalWrite(ledC, LOW);
 digitalWrite(ledG, LOW);

}







Mixing Colors with RGB


For this project assignment we had to keep the same wiring as the last one, however we had to change the code. We then had to modify the following code to show 5 more colors. When we mixed the colors, turning on 2 or 3 lights at the same time we got other colors. We got more creative and decided to mix 5 different colors and show them each for 5 seconds, then show the next one.

In example if you turned off all the lights and then put



analogWrite(greenpin,255);
analogWrite(bluepin,255);


You would get Yellow. A mix of green and Blue. Let the light reflect off your hand and you should see the yellow light.


If you go to this site Colors  you will see how to mix colors
                                                                                                                   
                                                                                                                     
                                                                                                               

Counting with the 7 Segment Display

For this assignment we had to touch bases with the (SSD). A seven-segment display (SSD), or seven-segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot-matrix displays. Seven-segment displays are widely used in digital clocks, electronic meters, and other electronic devices for displaying numerical information.

In summary for this a very assignment we had to;

Step 1 - Find out what A Seven Segment Display was.
Step 2 -  Gather the Parts & Tools to full-fill this assignment.
Step 3 - Once we placed the tool and parts on the given spots on the breadboard we began our                 Testing
Step 4 - The we had to try again to Built The Circuit.
Step 5 - Once built we began the One Digit Count Down Timer
Step 6 - Multiplexing
Step 7 -Finally we began the Two Digit Count Down Timer
Picture of What Is A Seven Segment Display?

Monday, November 23, 2015

The Button Challenge

For this post, our challenge is pretty similar to Project 10. Like the one before, we had to light up an LED light using the code given to us. The only difference is that it'll have the ability to both turn on and turn off the light. If the light is off, it'd turn on and if the light was off, it'd turn on an LED light. For this post we had to have a variable. To begin we set it at 0. After pushing the button, if the variable was 0, we'd turn on the light and set the variable to 1. If the button is pushed and has the variable off 1, to turn it off, push the button and set the variable back to 0.

Setting up the Seven Segment Display

For this assignment we interacted with the seven segment display which goes across the board, not parallel to the longer side. Now we are going to work on a Seven Segment display. This is a very complex and challenging project. It works just like our external LED program, except it has 7 LEDs all together in one small chip. We will be able to count and display letters with this chip. This program gave us an idea of how you would light up a calculator display.You can see the seven segments up above. We were not concerned with the DP (decimal point light), but if we were writing a calculator program we would have needed it. When you are inserting this chip in the breadboard, make sure you do not bend the pins! Have the decimal point facing your Arduino. By connecting to the different pins, we will be able to make different segments of our display go on. 

Steps Followed

  1. First connect GND on Arduino to the third row from the top of the seven segment display. Then connect one of the slots (in picture we used slot 13) the Arduino to a row on the breadboard above the seven segment display. 
  2. Then use a resistor to from that row to a row above or below the seven segment display.
  3. We then start by putting our 7 Segment display chip on to the breadboard. One of set pins can be in column C and the other in column G. You can put it in any row, but it’s better somewhere in the middle (see picture below). 
  4. The next thing we hadto do is connect a wire on the breadboard to a Ground (GRD) on the Arduino. The ground (black wire below) has to be in a row three from the top of the 7 Segment Display. So if the first row was 28 like it is below , then we have to put a ground in row 31.