Page 2 of 6 FirstFirst 123456 LastLast
Results 11 to 20 of 56

Thread: Looking for assistance with writing FSUIPC offsets

  1. #11
    150+ Forum Groupie
    Join Date
    Nov 2013
    Location
    Evansville, Indiana
    Posts
    251

    Re: Looking for assistance with writing FSUIPC offsets

    Make sure your capital O (oh's) are not number Zeros.

    ~Fess
    I will only ever be, half the Geek that I wished I was.
    TheGeekForge.Com

  2. #12
    25+ Posting Member
    Join Date
    Feb 2010
    Location
    KFLL
    Posts
    57

    Re: Looking for assistance with writing FSUIPC offsets

    Hey, Fess--

    All the letter 'O' or 'o' characters that are supposed to be letters....are.
    All of the number '0' characters that are supposed to be numeric....are.

    I'm glad you had the thought as well; it was the first thing I looked at during the compilation errors....

    Jay
    KFLL

  3. #13
    150+ Forum Groupie
    Join Date
    Nov 2013
    Location
    Evansville, Indiana
    Posts
    251

    Re: Looking for assistance with writing FSUIPC offsets

    Try moving the string declarations out of the void setup().

    Put them above it with the int declarations.

    ~Fess
    I will only ever be, half the Geek that I wished I was.
    TheGeekForge.Com

  4. #14
    25+ Posting Member
    Join Date
    Feb 2010
    Location
    KFLL
    Posts
    57

    Re: Looking for assistance with writing FSUIPC offsets

    Fess--



    SUCCESS.....well, sorta!!!!


    Thanks to your suggestion, it compiled.
    1 int CodeIn; // Used for all serial reads
    2 int engOneN1StepperPosition; // Tracks current step count for stepper motor
    3 int engOneN1StepperPin1 = 8; // Blue - 28BYJ48 pin 1
    4 int engOneN1StepperPin2 = 9; // Pink - 28BYJ48 pin 2
    5 int engOneN1StepperPin3 = 10; // Yellow - 28BYJ48 pin 3
    6 int engOneN1StepperPin4 = 11; // Orange - 28BYJ48 pin 4
    7 int engOneN1StepperLookup[8] = {B01000, B01100, B00100, B00110, B00010, B00011, B00001, B01001};
    8 int engOneN1StepperDelay = 1500;
    9 String engOneN1String, engOneN1StringOld; int engOneN1;
    10
    11
    12 void setup() {
    13 pinMode(engOneN1StepperPin1, OUTPUT);
    14 pinMode(engOneN1StepperPin2, OUTPUT);
    15 pinMode(engOneN1StepperPin3, OUTPUT);
    16 pinMode(engOneN1StepperPin4, OUTPUT);
    17 Serial.begin(115200);
    18 engOneN1StepperPosition = 512; //Sets motor position to worst-case scenario location
    19 Serial.println("Gauge reset and configured.");
    20 }
    21 void loop()
    22 {
    23 INPUTS();
    24 if (Serial.available()) {
    25 CodeIn = getChar();
    26 if (CodeIn == '#') {
    27 EXPERT();
    28 }
    29 if (CodeIn == '=') {
    30 EQUALS();
    31 }
    32 if (CodeIn == '<') {
    33 LESSTHAN();
    34 }
    35 if (CodeIn == '?') {
    36 QUESTION();
    37 }
    38 if (CodeIn == '/') {
    39 SLASH();
    40 }
    41 }
    42 }



    There is no stepper movement and I suspect (based solely on my very limited knowledge), I do need to have some type of 'return' and/or 'return map' operation. For this script, I'm only using the N1 gauge for readings and will add the other Engine 1 gauges when I have a much better understanding. After that, I'll add Engine 2 and Engine 3 gauges/readings.


    I'll be looking at the return/return map operation(s) and will report the progress.


    Thank you very much for the kick in the right direction.


    Much obliged.



    Jay
    KFLL

  5. #15
    25+ Posting Member
    Join Date
    Feb 2010
    Location
    KFLL
    Posts
    57

    Re: Looking for assistance with writing FSUIPC offsets

    I did much cutting-and-pasting from a script for a flaps gauges from another member here and adapted it to my Engine 1 N1 stepper using the return function.
    It compiled fine after a few tweaks but the stepper doesn't move.


    Will continue to search for viable options.



    I know that someone successfully hooked-up an RPM gauge using Arduino and air-core movements but can't find the code to see how s/he did it; I saw a pair of videos on it.


    The search continues......


    Jay
    KFLL

  6. #16
    25+ Posting Member
    Join Date
    May 2014
    Location
    Bulgaria and United Kingdom
    Posts
    56

    Re: Looking for assistance with writing FSUIPC offsets

    Hi Jay, steppers work in a different way, I'll have a look , can't promise anything though . Steppers are real pain for me too.

  7. #17
    25+ Posting Member
    Join Date
    Feb 2010
    Location
    KFLL
    Posts
    57

    Re: Looking for assistance with writing FSUIPC offsets

    Trakon--
    I hear ya! I've gone through more aspirin than I'd care to admit to trying to figure out the coding and experimenting.
    For what its worth, I've got several of the 28BYJ-48 DC 5V 4-Phase 5-wire steppers. Also, automotive steppers from a company called MCR; its their MR 1107 series.
    Any help is assuredly appreciated.
    Thank you again.
    Jay
    KFLL

  8. #18
    150+ Forum Groupie BuzziBi's Avatar
    Join Date
    Mar 2013
    Location
    Norway
    Posts
    276

    Re: Looking for assistance with writing FSUIPC offsets

    In youre code you have:
    line - 18 engOneN1StepperPosition = 512; //Sets motor position to worst-case scenario location
    line - 19 Serial.println("Gauge reset and configured.");
    By this, I guess you are using code from this thread:
    http://www.mycockpit.org/forums/showthread.php?t=27379
    But in youre code "void loop" you are not telling the stepper to do anything!
    You have to use rest of the code in that thread to fit what you want to do.
    Life was hard, but then came Windows 7.
    Now we can fly! --------
    --------

  9. #19
    25+ Posting Member
    Join Date
    Feb 2010
    Location
    KFLL
    Posts
    57

    Re: Looking for assistance with writing FSUIPC offsets

    Hi, Buzz.

    Yeah, I figured that out in the middle-of-the-night when I couldn't sleep.

    I got the sketch to compile but didn't do anything with the stepper.

    I know it has something to do with the 'return' and 'return map' functions. And yes, the code that I'm playing with did come from the thread you posted.
    For what its worth, I'm also tweaking that original code for my flap gauges (different flap settings)...little success there, either! But, I'm having fun learning.

    Jeg er glad for at du postet et svar. Jeg respekterer ditt arbeid her.

    Tusen takk!!


    Jay
    KFLL

  10. #20
    25+ Posting Member
    Join Date
    Jan 2015
    Location
    Manchester UK
    Posts
    38

    Re: Looking for assistance with writing FSUIPC offsets

    Jay,


    Arduino: 1.6.1 (Windows 7), Board: "Arduino Uno"
    sketch_apr12b.ino: In function 'void EXPERT()':
    sketch_apr12b.ino:43:7: error: 'engOneN1String' was not declared in this scope
    sketch_apr12b.ino:49:29: error: 'engOneN1StringOld' was not declared in this scope
    sketch_apr12b.ino:50:9: error: 'engOneN1' was not declared in this scope
    sketch_apr12b.ino:52:9: error: 'engOneN1StringOld' was not declared in this scope
    Error compiling.

    All the error is saying is that it can't find those variables. They are normally
    declared at the head of the code. If you look at Trakon's, you'll find them declared
    at the top:=


    String engOneN1String, engOneN1StringOld; int engOneN1;
    String engOneN2String, engOneN2StringOld; int engOneN2;
    String engOneEPRString, engOneEPRStringOld; int engOneEPR;
    String dotKickOut;

    regards paul.h

Page 2 of 6 FirstFirst 123456 LastLast