Lavanya Kondragunta
Published

IoT- Turn on LEDs by sending email

Email to turn on LED show.

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

Things used in this project

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