Results 1 to 3 of 3
  1. #1
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Jan 2012
    Location
    Miami, Florida USA
    Posts
    5
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Integer and character (ascii) issues when add myservo.write (airsp) need conversion???

    Hi Jim

    We ended up purchasing a Mega card it worked out fiine, extra i/o for servos. Thanks for info where I could explaination of Keys software. Got all hardware connected using Digital pin 52,50,48,46,44 and 42 for servo 1,2,3,4,5,6 signal pins. Ran a servo loop code to exercise each servo. Then ran a code to run pairs for pitch up servos (1,2) with servos (3,4) set constant and pitch down vise-versa. Did not know Servo library allows any pin to be set up to run servo. Thanks for that info.

    Ran into a problem when tryed to integrate servos into PED. We set PED code " if (j1 = ("W")" to if (j1 = ("A") for pitch instead of airspeed. Added four more lines of "airsp += char(Serial.read());" was able to now see all pitch character on LCD. Added servo library (#include < Servo.h>), added Servo myservo; Servo myservo1; this allowed servos to run more syncronized. Added

    myservo.attach(52);
    myservo.write(airsp);

    myservo1.attach(50);
    myservo1.write(airsp);

    after lcd.print (airsp); and ran into integer and character (ascii) issues, we did not consider this in our infinite wisdom (this is the fun part, where we begin learning code). Been at it all day...Tryed several ideas to no avail ... I'm thinking we need to add some conversion prior to servo write..... Any ideas???.....your help is appreciated.


    Thanks for Everything
    HCarter

  2. #2
    500+ This must be a daytime job Jim NZ's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    764
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Integer and character (ascii) issues when add myservo.write (airsp) need conversion???

    Woops ,, I thought one of the other guys might have answered this ,,, It's been talked about before and I haven't (yet) had a play at converting ,,, have a look-see at ,,

    http://www.mycockpit.org/forums/show...ED-display-FSX
    Post 35

    where Tony posted a way to do it and has even posted a PDE on his website showing how ,,, AND he is also driving servo's so have a dig around his site.

    A direct link to the said PDE ,,,
    http://www.erj145.com/cgi-bin/erj/index.pl?n=mti2c
    look around lines 108 to 120 for a complete "read and convert".

    A suggestion ,, it's a neat project your on there and there's going to be interest in it from other guys.
    How about opening a thread ,, give it a descriptive name ,, give a brief rundown and keep all your questions etc in the one thread ,, that way any-one following your progress can follow the whole development on one thread and learn from what you are up to ??


    Have fun ,,, Jim
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  3. #3
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Jan 2012
    Location
    Miami, Florida USA
    Posts
    5
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Integer and character (ascii) issues when add myservo.write (airsp) need conversion???

    Thanks Jim

    I was not sure if were dealing with ACII characters in DEC or Hex will give it a try. Sounds like a good idea to run a thread, not sure how thats done (I'm sure the students know). I will talk to the students about it.... we certainly would like to share our experiences with the greater community. Will keep you posted.

    Thanks Again

    HCarter