Skills Dev 1: Nicole

Made by Nicole Chu · UNLISTED (SHOWN IN POOLS)

Skills Dev 1: A Simple Internet Appliance

Created: December 13th, 2020

0

A Simple Internet Appliance: Making an LED Blink

To better understand the Particle platform and get started with circuit-building, our first skills development activity had us making an LED blink, with different sub-exercises exploring this further.

0

Our first task was to follow the instructions listed on the Lab site to make an LED blink every 1 second. See code below.

0
int ledPin = D2;

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

void loop() {
  // First... On
  digitalWrite(ledPin, HIGH);   // Turn ON the LED pins
  delay(1000);               // Wait for 1000mS = 1 second

  // Now... Off
  digitalWrite(ledPin, LOW);   // Turn OFF the LED pins
  delay(1000);               // Wait for 1000mS = 1 second
  // rinse + repeat

}
Click to Expand
0

Exercise 1 

Modify the program to Blink on and off every 3 seconds.

0
int ledPin = D2;

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

void loop() {
  // First... On
  digitalWrite(ledPin, HIGH);   // Turn ON the LED pins
  delay(3000);               // Wait for 3000mS = 3 seconds

  // Now... Off
  digitalWrite(ledPin, LOW);   // Turn OFF the LED pins
  delay(3000);               // Wait for 3000mS = 3 seconds
  // rinse + repeat

}
Click to Expand
0

Exercise 2

Change the program to blink on and off 5 times then stop for 3 seconds. Each blink should be 0.5s (a half second)

0
int ledPin = D2; // initialize pin D2 where LED is connected to

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

}

void loop() {
  
  // loop to turn LED on 5 times
  for (int i = 1; i < 6; i++){
    digitalWrite(ledPin, HIGH);   // Turn ON the LED pins
    delay(500); // Wait for 500mS = 0.5 seconds
    digitalWrite(ledPin, LOW);   // Turn OFF the LED pins
    delay(500); // Wait for 500mS = 0.5 seconds

  }
  
  digitalWrite(ledPin, LOW);   // Turn OFF the LED pins
  delay(3000);  // Wait for 3000mS = 3 seconds
  // rinse + repeat

}
Click to Expand
0

Exercise 3

Go back to the original program. Now add a second LED to the circuit.

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 ledPin1 = D2; // initialize pin D2 where LED 1 is connected to
int ledPin2 = D3; // initialize pin D3 where LED 2 is connected to

void setup() {
  // We want to tell the Argon that we'll use
  // D2 and D3 as output pins.
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);

}

void loop() {

  digitalWrite(ledPin1, HIGH);   // Turn ON the LED 1 pins
  digitalWrite(ledPin2, LOW);   // Turn OFF the LED 2 pins
  delay(1000);               // Wait for 3000mS = 3 seconds

  digitalWrite(ledPin1, LOW);   // Turn ON the LED 1 pins
  digitalWrite(ledPin2, HIGH);   // Turn OFF the LED 2 pins
  delay(1000);               // Wait for 3000mS = 3 seconds

}
Click to Expand
0

Reflection & Next Steps

Although I already have experience with Arduino and circuit building, this activity was a good refresher on the basics and provided a good introduction to the Particle platform.

If I had more time, I would have liked to explore the Connected LED exercises. After this activity, I will move onto Skills Dev 2.

x
Share this Project

This project is only listed in this pool. Be considerate and think twice before sharing.


Courses

About

Skills Dev 1: A Simple Internet Appliance