45 lines
844 B
C++
45 lines
844 B
C++
int MOTOR=3;
|
|
int i;
|
|
byte velocidad = 1;
|
|
int pausa = 12000;
|
|
|
|
void setup(){
|
|
pinMode(MOTOR, OUTPUT);
|
|
//Serial.begin(115200);
|
|
analogWrite(MOTOR, 0);
|
|
}
|
|
|
|
void loop(){
|
|
/*
|
|
for(i=150; i<=255; i++){
|
|
analogWrite(MOTOR, i);
|
|
//Serial.print(" "+String(i));
|
|
delay(velocidad);
|
|
}
|
|
//Serial.println("");
|
|
delay(pausa);
|
|
for(i=255; i>=150; i--){
|
|
analogWrite(MOTOR, i);
|
|
//Serial.print(" "+String(i));
|
|
delay(velocidad);
|
|
}
|
|
//Serial.println("");
|
|
*/
|
|
analogWrite(MOTOR, 215);
|
|
delay(pausa);
|
|
analogWrite(MOTOR, 0);
|
|
delay(5000);
|
|
analogWrite(MOTOR, 235);
|
|
delay(pausa);
|
|
analogWrite(MOTOR, 0);
|
|
delay(5000);
|
|
analogWrite(MOTOR, 255);
|
|
delay(pausa);
|
|
/*
|
|
analogWrite(MOTOR, 255);
|
|
delay(pausa);
|
|
analogWrite(MOTOR, 0);
|
|
delay(velocidad);
|
|
*/
|
|
}
|