int motorPin = 9; //For PWM signal
int mspeed = 0; // initializing motor speed
int mStep = 15; //Steps for increasing speed from 0 to 255
void setup()
{
pinMode(motorPin,OUTPUT);
Serial.begin(9600);
Serial.println("Vacuum pump pressure testing using code");
}
void loop()
{
analogWrite(motorPin, mspeed); // Writing At pin 9 ( Speed initially 0)
Serial.print("Speed : ");
Serial.println(mspeed);
mspeed = mspeed+mStep;
if(mspeed <=0 || mspeed >=255)
{
mStep = -mStep;
}
delay(500);
}