1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Dan's 3dofDuino Ver. 0.02 - Arduino interface for X-Sim2

Discussion in 'SimTools compatible interfaces' started by DanielDk, Feb 27, 2012.

  1. pingua

    pingua New Member

    Joined:
    Jan 26, 2013
    Messages:
    1
    Balance:
    6Coins
    Ratings:
    +0 / 0 / -0
  2. aarondc

    aarondc Member

    Joined:
    Jun 12, 2013
    Messages:
    133
    Location:
    Melbourne, Australia
    Balance:
    192Coins
    Ratings:
    +7 / 0 / -0
    I don't know, sorry, but wanted to say that I have been developing software for over 20 years, and found the explanation for setting up axes confusing.

    use the last value to set a constant bitmask.

    Not the sort of language you hear every day.

    :?
  3. DanielDk

    DanielDk Member

    Joined:
    Feb 27, 2012
    Messages:
    38
    Balance:
    386Coins
    Ratings:
    +12 / 1 / -0
    Hi Aarondc


    I'm trying to figure out where you got that sentence from.. Cause you are quite right, it makes no sense... :)


    As far as i can see it is nowhere to be forund in the code or this thread?


    Just to elaborate on how to setup axis:
    in the arduino code:

    To configure a servo output, add the following line to the setup section of the code: defineServo('X',9,0,255,32768);
    (one servo has allready been defined as an example)
    You can add multiple lines to configure multiple servos... just rember to change the axis X and the arduino output pin 9


    To configure a PWM output, add the following line to the setup section of the code: definePwm('Y',45,0,1023,32768,50,51,0,52,20000);
    (one pwm output has allready been defined as an example)
    You can add multiple lines to configure multiple pwm outputs.... just rember to change the axis and arduino pins to unused values.

    In the above example we define an X and a Y axis.




    The X and Y lettes in definepwm and defineservo must mach the lettes used in the x-sim2 USO:

    1-axis example for x-sim2: here we define the Y-axis
    ~36~~a01~Y~35~

    2-axis example for x-sim2: here we define the Y-axis and the X-axis
    ~36~~a01~Y~a02~X~35~

    3-axis example for x-sim2: you get the point :)
    ~36~~a01~Y~a02~X~a03~Z~35~

    Cheers
    Daniel
  4. DanielDk

    DanielDk Member

    Joined:
    Feb 27, 2012
    Messages:
    38
    Balance:
    386Coins
    Ratings:
    +12 / 1 / -0
    Hey Pingua


    nope :)

    you need to use the USO output settings: 16 bits - HEX - 115200 - 8 - NOPARITY - ONESTOPBIT

    the big textwindow should only read something like:

    ~36~~a01~Y~a02~X~a03~Z~35~

    /Daniel
  5. aarondc

    aarondc Member

    Joined:
    Jun 12, 2013
    Messages:
    133
    Location:
    Melbourne, Australia
    Balance:
    192Coins
    Ratings:
    +7 / 0 / -0
    Did you look at the screen shot in the post preceding mine? Here it is:

    [​IMG]

    The sentence I typed is right there, in that screen shot, right after the word, Tip:
  6. DanielDk

    DanielDk Member

    Joined:
    Feb 27, 2012
    Messages:
    38
    Balance:
    386Coins
    Ratings:
    +12 / 1 / -0

    Ahh i see - i thought it was something i had written.





    Cheers
    /Daniel