myGame

Screen Shot 2017-06-05 at 12.48.38 PM.png

When either a left, right, up, or down button is pressed the circle that initially starts in the center of the console moves, and the circle changes color when each button is pressed. When the up button is pressed when the circle is traveling up the circle moves quicker; when the circle is traveling, but you press the down button the circle startsslowing down. Screen Shot 2017-06-05 at 12.53.42 PM.png

This shows that when the when either a left, right, up, or down button is pressed the circle does not change colors anymore, but what does change is the color of the background of the controller and the buttons. When the circle hits any wall, but the top one, the color of the background and buttons change to gray. When either the buttons are pressed or the circle hits the ceiling of the console the colors of the background and buttons change.

Screen Shot 2017-06-05 at 1.02.20 PM.png

This screenshot is showing that when the circle touches a wall or a button is pressed by the user the color of the background and buttons change.

myBlink

mig RB.JPG

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // leave it on for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(100); // turn off for a tenth of a second
digitalWrite(13, HIGH); //turn the LED on (HIGH is the voltage level)
//leave it on for a seventh of a second
delay(700);
digitalWrite(13, LOW); //turn the LED off by making the voltage LOW
//turn off for a quarter of a second
delay(250);
digitalWrite(13, HIGH);//turn the LED on (HIGH is the voltage level)
//leave it on for a sixth of a second
delay(600);
digitalWrite(13, LOW); //turn the LED off by making the voltage LOW
//turn off for a half of a second
delay(500);
digitalWrite(13, HIGH);//turn the LED on (HIGH is the voltage level)
//leave it on for 85 percent a second
delay(850);
digitalWrite(13, LOW);//turn the LED off by making the voltage LOW
//turn off for 200th of a second
delay(50);
digitalWrite(13, HIGH);//turn the LED on (HIGH is the voltage level)
//leave it on for 1 and 1/5 of a second
delay(1200);
}

Electrical Vs Electronics

Electrical definition- Objects which takes electricity and turns it into some other form of energy like light, motion, heat, anti heat, etc.

Electronic definition- Objects which for the most part has some type of computer controlling these objects, and or objects like transistors, diodes, and integrated circuits.

Electronic circuits have the ability of precessing things whilst electronics do not have this ability.

List of disadvantages NYC faced in switching to electronic traffic lights

  • The traffic lights throughout the city can be hacked through a computer and that can cause major disasters.
  • People would have to be retrained to learn how electronic lights work from once knowing how they work through an electric point of view.
  • This costed a lot of time and money to install these new electronic lights.

 

List of advantages NYC faced in switching to electronic traffic lights

  • No one well need to go to each individual traffic light pole and fix the wiring to fix the light.
  • Traffic will flow smoothly with an automated timed, computerized light controlled system.
  • It will improve the safety of people if the lights work properly 95% percent of the time.
  • Traffic lights can be fixed quicker if someone is always monitoring the NYC traffic lights in a certain area.

 

I think NYC did the right thing in changing a lot of NYC traffic lights to be electronically instead of electrical because, driving becomes smoother meaning less accidents and more safety, hence less traffic; which is always a good thing! If a problem come ups with a light, the fixing of the light would come quicker because it is electronically controlled instead of electrically controlled.

 

 

Parallel Circuits

Screen Shot 2017-05-18 at 12.43.15 PM

Virtual Circuit A Parallel, 2 Switches, 2 resistors

Screen Shot 2017-05-18 at 12.55.07 PM

Virtual Circuit B Parallel, 2 switches one resistorScreen Shot 2017-05-23 at 12.44.32 PM

My virtual circuit where a switch keeps on two lights and the other two can be controlled by pressing on whichever switch you choose. -My Circuit

mig parallel circ A.JPG

Physical Circuit A Parallel, 2 Switches, 2 resistors

mig circ 2 parallel (1).JPG

Physical Circuit B Parallel, 2 switches one resistor

mig circ 2 parallel

My physical circuit where a switch keeps on two lights and the other two can be controlled by pressing on whichever switch you choose. -My Circuit

A Simple Circuit

zCircuit Board

FullSizeRender (2)Screen Shot 2017-05-08 at 12.48.02 PM

Positive energy flows from the positive lead of the battery and then goes through the switch if the switch allows it to, and then the flow energy continues until it hits a resistor in which the resistor limits the amount of energy going into whatever it is powering. The thing gets powered and in this case it is a red led and then negative energy goes back into the battery.

Electrical Safety

1st. Metal is a great conductor of electricity

  • Don’t wear metal jewelry or watchbands when working on electrical circuits.
  • Use tools with non-conducting handles.
  • When possible, work on electrical circuits with 1 hand, keeping the other away from conductive materials.

http://resources.schoolscience.co.uk/Corus/16plus/steelch1pg2.html

2nd. Another decent conductor of electricity is water

  • Never work with electrical circuits with wet hands or on a wet floor.
  • If there is a spill, shut off the main power before doing anything else.

http://www.physlink.com/education/askexperts/ae61.cfm

3rd. A so-so conductor of electricity are humans

  • Don’t touch electrical circuits with your fingers.
  • Treat all electrical devices as if they are energized.
  • Disconnect the power source before working on electrical circuits and devices.
  • When possible, work on electrical circuits with 1 hand, keeping the other away from conductive materials.
  • Should someone come into contact with electricity, don’t touch them; shut down the main power.
  • Never touch anyone’s electrical circuits unless invited to do so.
  • Enclose all electrical contacts and conductors.
  • Always de-energize electrical circuits when done working with them.
  • Do not wear loose or hanging clothing near electrical equipment.
  • Always drain capacitors before working near them.

https://socratic.org/questions/why-is-the-human-body-is-a-good-conductor-of-electricity

 

bounce.pde

Screen Shot 2017-04-03 at 12.54.00 PM

The is the first bounce version, I managed to add movement to the circle in all four directions. I also had the circle change color when the middle button on the device had it been pressed.

Screen Shot 2017-04-06 at 12.41.17 PM.png

I added a new color to the circle every time I change the direction of the circle in the second version of the code.

Screen Shot 2017-04-06 at 12.45.08 PM.png

In the third version of bounce I added to the code, code to make it so that the ball bounces off the north and south end of the device’s screen.

Screen Shot 2017-04-06 at 12.47.05 PM.png

In the fourth version of bounce I added to the code, code to make it so that the ball bounces off the eastern end of the device’s screen.

Screen Shot 2017-04-06 at 12.48.56 PM.png

In the fifth, and final version of bounce I added to the code, code to make it so that the ball bounces off the western end of the device’s screen; hence the ball being able to bounce off all sides of the device.

control.pde

// This Processing program creates a little animation machine
// with controls that you can customize.
// First, we need to “declare” a few variables of 3 different types.
int bDia, cDia, mvX, mvY;
float cX, cY, clickX, clickY;
color cCol;

void setup() {
size(201, 400);  // Create a program window 201 pixels wide and 400 pixels high.
stroke(127); // Set the color for the outlines of our shapes.
bDia = 20; // Set the diameter of our circular control buttons.
cDia = 20; // Set the diameter of the “action circle” we will control.
cX = 100;  // Set the starting horizontal position of the action circle.
cY = 300;  // Set the starting vertical position of the action circle.
cCol = color(255, 255, 255);  // Set the starting color of the action circle.
mvX = 0;  // Set the horizontal movement of the action circle.
mvY = 0;  // Set the vertical movement of the action circle.
}

void draw() {
// These first 4 lines let you use math coordinates instead of computer coordinates.
scale(1, -1);
translate(0, -height);
clickX = mouseX;
clickY = height – mouseY;

fill(255); // Color the screen white.
rect(0, 200, 200, 200);  // Draw the square “action screen”.

ellipse(100, 60, bDia, bDia); // Draw the bottom button.
ellipse(100, 100, bDia, bDia); // Draw the middle button.
ellipse(100, 140, bDia, bDia); // Draw the top button.
ellipse(60, 100, bDia, bDia); // Draw the left button.
ellipse(140, 100, bDia, bDia); // Draw the right button.

fill(cCol);  // Set the color for the action circle.
cX = cX + mvX; // Set the horizontal position of the action circle.
cY = cY + mvY; // Set the vertical position of the action circle.

// The 2 “print lines” below will display at the bottom of this window.
// They will let us check the coordinates of the program window.
println(“X =”, clickX);
println(“Y =”, clickY);

ellipse(cX, cY, cDia, cDia); // Draw the action circle.
}

void mousePressed() {
//Check if the user clicked the middle button.
if (dist(clickX, clickY, 100, 100) < bDia/2) {
cCol = color(255, 0, 0);
// If so, turn the action circle red.
}

//Check if the user clicked the top button.
else if (dist(clickX, clickY, 100, 140) < bDia/2) {
mvY = 1;
//If so, make the action circle move upwards.
}
//Check if the user clicked the bottom button.
else if (dist(clickX, clickY, 100, 60) < bDia/2) {
mvY = -1;
//If so, make the action circle move downwards.
}
//Check if the user clicked the left button.
else if (dist(clickX, clickY, 60, 100) < bDia/2) {
mvX = -1;
//If so, make the action circle move left
}
//Check if the user clicked the right button.
else if (dist(clickX, clickY, 140, 100) < bDia/2) {
mvX = 1;
//If so, make the action circle move right.
}

}