title: how do i read and output pwm with a black pill board?
body: <p>I am making an stm32 based motor speed controller for a DC motor. But I can't read PWM off my receiver and I can't make my MOSFET vary the output! I need help because now it's only on or off! I am using a RobotDyn BlackPill and an STP36NF06L Mosfet. And also I use Arduino ide with the STM board.
  Code:</p>
  <pre><code>int Motor = PA15;
  int rc = PB1;
  int s;
  
  
  void setup() {
    pinMode(Motor, OUTPUT);
    pinMode(rc, INPUT);
    digitalWrite(Motor, LOW);
  }
  void loop() {
     if(s = (map(pulseIn(rc, HIGH), 1100, 1900, 0, 255)) &gt; 200) {
      digitalWrite(Motor, HIGH);
    }
    else{
      digitalWrite(Motor, LOW);
    }
    delay(10);
  }
  </code></pre>