MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

Go to page 1Go to page 2123Go to page 4Go to page 3
Avatar
fusa
From: EDDF
Posts: 57
Supporter
Hi Sebastian,

hatte es mit dem default Wert 500 probiert und eben nochmal mit 1000.
Es hat keine Eile, ich war heute nur in experimentier Laune :)
2016-01-30 16:15
Avatar
DocMoebiuz
From: EDSH, Germany
Posts: 1516
Naja drehen sollten sich die stepper auf jeden Fall ohne Probleme
Have a great day!
Sebastian

MobiFlight - Simply build your own home cockpit for your favorite flight sim - MSFS2020, FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2016-01-30 16:57
Avatar
fusa
From: EDDF
Posts: 57
Supporter
Kann ich die Schrittmotoren ohne das Arduino Board testen? Vielleicht 5V an einem der Input Pins anlegen?
2016-01-30 16:59
Avatar
masawee
Posts: 64
just i test whit uno board(no mobiflight software)
how stepper motor work.
have good test first time working you motor.
this motor and driver
http://www.ebay.com/itm/181266971629?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
stepper have gear ratio 1/64 and step/rev 4096
speed about 100-200 max 300, 400 no working.sweeep motor front/back good, first test.
step angle is 5,625 degree/360deg, what mean if yuo gauge use about needle move 90 degree step you use 4096/4 =1024 step=90/5,625deg=16 step max. gauge needle ?
i no sure :) i think use 1024 step maximum 0-full gauge needle ? at 90 degree gauge.


code
/*
BYJ48 Stepper motor code
Connect :
IN1 >> D8
IN2 >> D9
IN3 >> D10
IN4 >> D11
VCC ... 5V Prefer to use external 5V Source
Gnd
written By :Mohannad Rawashdeh
http://www.instructables.com/member/Mohannad+Rawashdeh/
28/9/2013
*/

#define IN1 8
#define IN2 9
#define IN3 10
#define IN4 11
int Steps = 0;
boolean Direction = true;// gre
unsigned long last_time;
unsigned long currentMillis ;
int steps_left=4095;
long time;
void setup()
{
Serial.begin(115200);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
// delay(1000);

}
void loop()
{
while(steps_left>0){
currentMillis = micros();
if(currentMillis-last_time>=1000){
stepper(1);
time=time+micros()-last_time;
last_time=micros();
steps_left--;
}
}
Serial.println(time);
Serial.println("Wait...!");
delay(2000);
Direction=!Direction;
steps_left=4095;
}

void stepper(int xw){
for (int x=0;x<xw;x++){
switch(Steps){
case 0:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
break;
case 1:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, HIGH);
break;
case 2:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
break;
case 3:
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
break;
case 4:
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
case 5:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
case 6:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
case 7:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
break;
default:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
}
SetDirection();
}
}
void SetDirection(){
if(Direction==1){ Steps++;}
if(Direction==0){ Steps--; }
if(Steps>7){Steps=0;}
if(Steps<0){Steps=7; }
}
[Last edited by masawee, 2016-12-17 16:05]
2016-12-17 15:55
Go to page 1Go to page 2123Go to page 4Go to page 3