meta données pour cette page
  •  


const int SN754410_12EN = 9;
const int SN754410_1A = 8;
const int SN754410_2A = 7;
float vitesse = 255;

void setup() {

        pinMode(SN754410_12EN,OUTPUT);
        pinMode(SN754410_1A,OUTPUT);
        pinMode(SN754410_2A,OUTPUT);
        Serial.begin(9600);
}

void loop () {
  float in;
  for (in = 0; in < 6.283; in = in + 0.001)
  {
    vitesse = sin(in) * 127.5 + 127.5;
    analogWrite (SN754410_12EN,vitesse);   // la vitesse varie en fonction du PWM (40 a 255) 
    digitalWrite(SN754410_1A,HIGH);   
    digitalWrite(SN754410_2A,LOW);
    delay(500); 
    Serial.println(vitesse);
  }
}