Check out example codes for "arduino for command". It will help you in understanding the concepts better.

Code Example 1

// Dim an LED using a PWM pin
int PWMpin = 10;  // LED in series with 470 ohm resistor on pin 10

void setup() {
  // no setup needed
}

void loop() {
  for (int i = 0; i <= 255; i++) {
    analogWrite(PWMpin, i);
    delay(10);
  }
}

Learn ReactJs, React Native from akashmittal.com