-
-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDE Failed to Open Arduino File/DC Motors #6322
Comments
whats with the scrolling text box at the top |
also if i just switch my poles on the DC motor it will spin the correct way to make the fan work, but it still runs the code incorrectly with no change in speed or direction |
@camandbass's forum post for this issue: |
Hi @camandbass , |
Hello Friends,
I can tell the code, although i didn't write it, would tell the motor to switch directions back and forth for a bit, to speed up and slow down, than show varying speeds in descending order.
Yet my DC motor shows no variety in speed or direction.
I know it's wired correctly, many different tripple checks, it is a match for what the lesson says and depicts, and what my training with IC's thinks it should be
My question is for what reason would Arduino IDE 1.8.2 not be able to open arduino files provided in the "most complete starter kit" when they could be accessed by Developer Virtuoso; and/or does the code below achieve what in its own footnotes claim to.
None of the code I downloaded from Elegoo in "arduino file" format can be opened by Arduino IDE 1.8.2, although it works great uploading sketches to my arduino mega; I've even reinstalled to no avail.
Basically if this code below is valid, theres something wrong with my motor
//www.elegoo.com
//2016.12.12
/************************
Exercise the motor using
the L293D chip
************************/
#define ENABLE 5
#define DIRA 3
#define DIRB 4
int i;
void setup() {
//---set pin direction
pinMode(ENABLE,OUTPUT);
pinMode(DIRA,OUTPUT);
pinMode(DIRB,OUTPUT);
Serial.begin(9600);
}
void loop() {
//---back and forth example
Serial.println("One way, then reverse");
digitalWrite(ENABLE,HIGH); // enable on
for (i=0;i<5;i++) {
digitalWrite(DIRA,HIGH); //one way
digitalWrite(DIRB,LOW);
delay(500);
digitalWrite(DIRA,LOW); //reverse
digitalWrite(DIRB,HIGH);
delay(500);
}
digitalWrite(ENABLE,LOW); // disable
delay(2000);
Serial.println("fast Slow example");
//---fast/slow stop example
digitalWrite(ENABLE,HIGH); //enable on
digitalWrite(DIRA,HIGH); //one way
digitalWrite(DIRB,LOW);
delay(3000);
digitalWrite(ENABLE,LOW); //slow stop
delay(1000);
digitalWrite(ENABLE,HIGH); //enable on
digitalWrite(DIRA,LOW); //one way
digitalWrite(DIRB,HIGH);
delay(3000);
digitalWrite(DIRA,LOW); //fast stop
delay(2000);
Serial.println("PWM full then slow");
//---PWM example, full speed then slow
analogWrite(ENABLE,255); //enable on
digitalWrite(DIRA,HIGH); //one way
digitalWrite(DIRB,LOW);
delay(2000);
analogWrite(ENABLE,180); //half speed
delay(2000);
analogWrite(ENABLE,128); //half speed
delay(2000);
analogWrite(ENABLE,50); //half speed
delay(2000);
analogWrite(ENABLE,128); //half speed
delay(2000);
analogWrite(ENABLE,180); //half speed
delay(2000);
analogWrite(ENABLE,255); //half speed
delay(2000);
digitalWrite(ENABLE,LOW); //all done
delay(10000);
}
Ultimate project is to use a motion sensor to turn on a fan for about a minute, then the fan turns off until prompted again.
Of course the blades are oriented to push air forwards when spinning clockwise
Thanks much if you suffer through reading this all
-Chris
The text was updated successfully, but these errors were encountered: