Lavanya Kondragunta
Published

IoT- Turn on LEDs by sending email

Email to turn on LED show.

BeginnerFull instructions provided4 hours1,177
IoT- Turn on LEDs by sending email

Things used in this project

Hardware components

LightBlue Bean
Punch Through LightBlue Bean
×1
Breadboard (generic)
Breadboard (generic)
×1
LED (generic)
LED (generic)
×4
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Node-RED on IBM Cloud
Node-RED on IBM Cloud

Story

Read more

Schematics

Breadboard setup

Code

LED simple chase pattern

Arduino
void setup() {
pinMode(2,OUTPUT);
    pinMode(1,OUTPUT);
    pinMode(3,OUTPUT);
    pinMode(4,OUTPUT);
}

void loop() {
    if(Bean.readScratchNumber(1)==1){
        
        digitalWrite(1,HIGH);
        digitalWrite(4,LOW);
        Bean.sleep(100);
        
        digitalWrite(2,HIGH);
        digitalWrite(1,LOW);
        Bean.sleep(100);
        
        digitalWrite(3,HIGH);
        digitalWrite(2,LOW);
        Bean.sleep(100);
        
        digitalWrite(4,HIGH);
        digitalWrite(3,LOW);
        Bean.sleep(100);
        
    }else{
        digitalWrite(2,LOW);
        digitalWrite(1,LOW);
        digitalWrite(3,LOW);
        digitalWrite(4,LOW);
        
    }
    Bean.sleep(100);
}

Credits

Lavanya Kondragunta

Lavanya Kondragunta

1 project • 2 followers
Mom, Developer, Geek, Curious Learner, Sweet toothed.

Comments

Add projectSign up / Login