Back to Parent

const int LEDPIN0 = D0;

void setup() {
    pinMode(LEDPIN0, OUTPUT);
    
    //Making a Connected LED
    digitalWrite(LEDPIN0, LOW);
    
    Particle.function("led", ledControl);
}

void loop() {
}

//Making a Connected LED
//Ex.2
int ledControl1(String num)
{
  int n = num.toInt();
  for(int i = 0; i < n; i++){
    digitalWrite(LEDPIN0, HIGH);
    delay(500);
    digitalWrite(LEDPIN0, LOW);
    delay(500);
  }
  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