Wednesday, 18 November 2015

Arduino Lab 1

Purpose:
Make an LED blink on and off

Equipment:
LED
Resistor
wire(any color)
wire(any color)
wire(any color)

Program Details:
I used Arduino

Time to Program and Complete:
Around 10 mins

Results:
I was connected to the wrong port, so I changed it in the tools tab

Photo/Video Proof:






















Program:
int ledPin = 13; - This creates a variable

void setup() - This declares the setup function to define what pins on our Arduino will do 

{ - This bracket shows us the start of the setup function

 pinMode(ledPin, OUTPUT); - pinMode allows us to define if a pin is an input or an outpud

} - This bracket shows us the end of the setup function 

void loop() - This declares a function to loop forever

{ - This bracket shows us the start of the setup function

 digitalWrite(ledPin, HIGH); - digitalWrite turns on power to a specific pin (0-13) at a specific value (1 - 255)

 delay(1000); - Delays arduino to wait a number of miliseconds before going to the next instruction

 digitalWrite(ledPin, LOW); - This digitalWrite is setting the power of ledPin (pin 13) to LOW or 0

 delay(1000); - Tells arduino to wait one second before looping to the top of the function

} - This bracket shows us the start of the setup function


Program Modifications:
none.

Helpful Tips:
Make sure you are on the right port.

References:
Kyle Chan, Aron Graca

1 comment:

  1. don't use - to add your comments. Use the proper / symbols.

    ReplyDelete