Back to Parent

int motorPin = D1;


void setup()
{
  pinMode(motorPin, OUTPUT);
  Particle.subscribe("muslimban", myHandler);
}

int i = 0;

void myHandler(const char *event, const char *data)
{
  analogWrite(motorPin, 50);
  delay(1000);
  analogWrite(motorPin, 100);
  delay(1000);
  analogWrite(motorPin, 150);
  delay(1000);
  analogWrite(motorPin, 200);
  delay(2000);
  analogWrite(motorPin, 255);
  delay(3000);
  analogWrite(motorPin, 0);
}
Click to Expand

Content Rating

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

0