Back to Parent

int fanPin = D2;

void setup() {

    pinMode( fanPin, OUTPUT );
    digitalWrite( fanPin, LOW );
    
    Particle.function("snow",snow);
    
}

void loop() {
    
}

void blowFan(int interval){
    for(int i = 0; i < 3; i++ ){
        digitalWrite( fanPin, HIGH );
        delay (interval);
        digitalWrite( fanPin, LOW );
        delay (interval);
    }
}

int snow(String command){
    int s = command.toInt();
    blowFan(s);
    return 1;
}
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0