Thanks for your reply runnerup, although I will have to call for your help once again as I am new to Arduino but the deadline for my project is fast approaching!! I am trying my best but am still getting compile errors, so I was hoping you could take a look at the source code I have written and with the knowledge that I am using an Arduino Uno and possibly you could spot what is going wrong!
# include "PWM.h"
//Initialize Motor 1
int InA1 = 8;
int InB1 = 12;
int PWM1 = 10;
int32_t frequency = 20000;
void setup()
{
InitTimersSafe();
bool success = SetPinFrequencySafe(PWM1, frequency);
if(success){
pinMode (InA1, OUTPUT);
pinMode (InB1, OUTPUT);
pinMode (PWM1, OUTPUT);}
}
void loop ()
{
{//Motor Start Delay
delay(1000);
//Motor Direction
digitalWrite(InA1, HIGH);
digitalWrite(InB1, LOW); }
//Motor Acceleration Control
{for(int fadeValue = 0 ; fadeValue <= 76; fadeValue +=5){
pwmWrite(PWM1, fadeValue);
delay(100000); }
}
//Motor Run Time
delay(10000);
//Motor Decceleration Control
{for(int fadeValue = 76; fadeValue >= 0; fadeValue -=5){
pwmWrite(PWM1, fadeValue);
delay(100000);
}
}
//Motor Stop Time
delay(10000);
}
Here is the error I am now getting. I have installed v4.0.
Many thanks!