Skills Dev I

Made by Gabriela Suazo

The goal of this project is to use the particle platform to manipulate LEDs.

Created: November 6th, 2020

0

Outcome

I used LEDs, resistors, and jumper wires to form connections on the breadboard and wrote code that made the LED blink. First, I made only one LED blink but later I added a second LED and made them alternate. 

0

Exercise 0

Making an LED Blink

0
int ledPin = D2;


void setup() {
    // Tell the Argon that we'll use D2 as an output pin.
    pinMode(ledPin, OUTPUT);
}


void loop() {
    // Turn on
    digitalWrite(ledPin, HIGH);   // Turn ON the LED pins
    delay(1000);               // Wait for 1000mS = 1 second
    
    // Turn off
    digitalWrite(ledPin, LOW);   // Turn OFF the LED pins
    delay(1000);               // Wait for 1000mS = 1 second
    // Repeat
}
Click to Expand
0
Skills Dev 1 | Exercise 0 - Making an LED Blink
Gabby Suazo - https://youtu.be/VEtMFzbwZXg
0

Process 

It took me a bit of experimenting with the board to understand where and how connections were made. Once I had it working, I changed the placement of the connections to see what would work and what wouldn't and I think this helped me understand the circuits better as I continued through the exercises.

0

Exercise 1

Modify the program to Blink on and off every 3 seconds

0
int ledPin = D2;


void setup() {
    // Tell the Argon that we'll use D2 as an output pin.
    pinMode(ledPin, OUTPUT);
}


void loop() {
    // Turn on
    digitalWrite(ledPin, HIGH);   // Turn ON the LED pins
    delay(3000);               // Wait for 3 seconds
    
    // Turn off
    digitalWrite(ledPin, LOW);   // Turn OFF the LED pins
    delay(3000);               // Wait for 3 seconds
    // Repeat
}
Click to Expand
0
Skills Dev 1 | Exercise 1 - Modify the program to Blink on and off every 3 seconds
Gabby Suazo - https://youtu.be/IXPSxaCiNTI
0

Exercise 2

Change the program to blink on and off 5 times then stop for 3 seconds

0
int ledPin = D2;


void setup() {
  // Tell the Argon that we'll use D2 as an output pin.
  pinMode(ledPin, OUTPUT);
}


void loop() {
    for (int i = 0 ; i < 5 ; i++) {
        // Turn on
        digitalWrite(ledPin, HIGH);   // Turn ON the LED pins
        delay(500);               // Wait for 0.5 second 
        // Turn off
        digitalWrite(ledPin, LOW);   // Turn OFF the LED pins
        delay(500);               // Wait for 0.5 second 
    }
    
    // Turn off
        digitalWrite(ledPin, LOW);   // Turn OFF the LED pins
        delay(3000);               // Wait for 3 seconds
        
}
Click to Expand
0
Skills Dev 1 | Exercise 2 - Change the program to blink on and off 5 times then stop for 3 seconds
Gabby Suazo - https://youtu.be/3f3JzwWV5bs
0

Exercise 3

Program the LED’s to alternate blinks i.e. when LED 1 turns on, LED 2 turns off, then when LED 2 turns on, LED 1 turns off

0
int ledPinYellow = D2;
int ledPinGreen = D3;


void setup() {
    // Tell the Argon that we'll use D2 as an output pin.
    pinMode(ledPinYellow, OUTPUT);
    pinMode(ledPinGreen, OUTPUT);
}


void loop() {
    // Turn on Yellow
    digitalWrite(ledPinYellow, HIGH);   // Turn ON the Yellow LED pin
    // Turn off Green
    digitalWrite(ledPinGreen, LOW);   // Turn OFF the Green LED pin
    
    delay(1000);               // Wait for 1000mS = 1 second
    
    // Turn on Green
    digitalWrite(ledPinGreen, HIGH);   // Turn ON the Green LED pin
    // Turn off Yellow
    digitalWrite(ledPinYellow, LOW);   // Turn OFF the Yellow LED pin
    
    delay(1000);               // Wait for 1000mS = 1 second
    
    // Repeat
}
Click to Expand
0
Skills Dev 1 | Exercise 3 - Program the LED’s to alternate blinks
Gabby Suazo - https://youtu.be/6pmb5a0ZEnI
0

Reflection

I now have a much better understanding of the breadboard and the potential connections that can be made. I think I have more difficulty with that than I do with the code because although I had never used the Particle build platform previously, for the most part, the code makes sense to me so I feel like I am able to build off of the example code that is provided. My next steps are to continue getting more familiar and comfortable with the breadboard.

x
Share this Project

Courses

About

The goal of this project is to use the particle platform to manipulate LEDs.