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

DIY Arduino Buttonbox

Discussion in 'DIY peripherals' started by TOPMO3, Mar 28, 2016.

  1. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Nice project from @vthinsel as usual
    • Agree Agree x 2
    • Like Like x 1
  2. Claudemir

    Claudemir Member Gold Contributor

    Joined:
    Oct 22, 2012
    Messages:
    168
    Balance:
    49Coins
    Ratings:
    +33 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Good morning mate!
    you could change the codgo the button v1 so I can use the folowing buttons?
    3 potentiometers used as brake, accelerator, clutch.
    2 encouder
    and buttons PUSCH
    and some keys of / on
    I wanted to let my independent pedal my steering wheel!
    It is how to do this?
    you help me?
    I do not understand the programecao but know you and master it thanks!
  3. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Hi @Claudemir ,

    yes, its possible, but I currently dont have enough free time to build it and spare parts to test it. I'm currently pretty busy with my pcu-6d project, but next project probably will be pedal controller and its seems its what you want ;)
  4. Claudemir

    Claudemir Member Gold Contributor

    Joined:
    Oct 22, 2012
    Messages:
    168
    Balance:
    49Coins
    Ratings:
    +33 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    that's right! @TOPMO3
    I gained a FANATEC wheel 911 GT3
    but I have not a set of pedals to be able to run
    then I wanted ceriar a lower cost of homemade pedal!
    all equipment are imported and here in Brazil is very expensive ask out already we pay a lot of taxes to import out!
    would be a great help to me thank you!
  5. TerminalKaos

    TerminalKaos New Member

    Joined:
    May 8, 2016
    Messages:
    15
    Location:
    Australia
    Balance:
    260Coins
    Ratings:
    +2 / 0 / -0
    This is exactly what I wanted for phase 2 of my sim. I will be bookmarking this and making this after the dash. Thank you so much
  6. mariana fino

    mariana fino

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hello ,i just buy a usb controller ,aply on a box them weld new buttons and pots ,chep solucion and easy! for iracing i have two button box made from usb controllers!
  7. mariana fino

    mariana fino

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi here is my button box ,i am doing another one were i conect 4 pots to the joystic on the controller 4 axis 4 pots !hope you enjoy,no code need!kkkkk!:thumbs

    Attached Files:

    • Like Like x 2
    • Dislike Dislike x 1
  8. MAYA One

    MAYA One Member

    Joined:
    Jul 7, 2015
    Messages:
    36
    Location:
    china
    Balance:
    468Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    2DOF, SCN5
    Once again, thanks for sharing the @TOPMO3, the two firmware is very good. Spare time to make a few pieces of PCB, to facilitate the connection button.:cheers[​IMG]
    • Like Like x 3
  9. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Hi @MAYA One

    very cool! :thumbs
    I'm currently choosing PCB manufacturer for another project, can you recommend someone?
  10. MAYA One

    MAYA One Member

    Joined:
    Jul 7, 2015
    Messages:
    36
    Location:
    china
    Balance:
    468Coins
    Ratings:
    +16 / 0 / -0
    My Motion Simulator:
    2DOF, SCN5
    Sorry @TOPMO3.I am in China.Here's a lot of PCB manufacturers, but transport is a big problem.
  11. Borja

    Borja New Member

    Joined:
    Jun 25, 2015
    Messages:
    12
    Location:
    Loja
    Balance:
    133Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    Arduino
    Hi, thanks for sharing the project. A question could be added to the 8-position rotary instead of 4 ?, which should be added to the code ?. thanks
  12. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Hi @Borja ,

    I'm not understand clearly what you mean. I'm using 4 (pcs) rotary encoders, not 4-way rotary switch.
    Do you want using rotary switches instead of encoders? Can you please post link to specs of rotary you would like to use?

    When I developed the buttonbox, I found its not very useful to implement support of rotary switches, because most of operations can be make using encoders.
    For example, imagine you made Brake Balance regulator using 8 - position rotary switch, i.e. very left position BB=1, then BB=2, etc, and most right position BB=8.
    Everything works, you are able to change BB while driving and all are fine. Until a moment when you forced to change BB by game ui control, or load qualy setup with different BB setting, or decided to drive a car with 12 (for example) BB regulator positions, etc etc. Since that moment yours BB regulator is not synced with in-game BB-position, so before jump to car you need to always check in-game setting, then correct yours BB control and so on. Briefly, rotary switch is not so flexible and problemless.
    Compare it with rotary encoder, its simple and dumb: CW rotation - increment setting, CCW rotation - decrement setting, not matter how many settings of BB a car has, nor what previous BB setting was, so I prefer to use encoders
  13. Borja

    Borja New Member

    Joined:
    Jun 25, 2015
    Messages:
    12
    Location:
    Loja
    Balance:
    133Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    Arduino
    Sorry if I explained bad, serious to use this type of rotary.
    (Leobodnar rotary switch)

    As used wheels F1.
    The idea is to increase turbo Assetto Corsa, use the keyboard from the 0 key to 10. I would use the rotary switch to quickly choose this value.

    One more question, where I could buy a plate pcb easy connection? with the name I could use and would look at ebay.

    Thanks and sorry for my English.
  14. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Well, I see

    Currently the sketch doesn't support rotary switches and TBH, I have no plans to add it.
    Switches need slightly different processing than buttons/encoders, basically you need to react to change switch position and, keep in mind previous positions (and after some debouncing), generate according "button" press. May be it helps you to develop your own code.

    Fastest way to resolve your problem is using buttons, not switches. For example, make 10 buttons in row and map them in game instead of 0 - 10 keys.
  15. Borja

    Borja New Member

    Joined:
    Jun 25, 2015
    Messages:
    12
    Location:
    Loja
    Balance:
    133Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    Arduino
    Thank you very much for the answers, I'll try as saying.

    A greeting
  16. Claudemir

    Claudemir Member Gold Contributor

    Joined:
    Oct 22, 2012
    Messages:
    168
    Balance:
    49Coins
    Ratings:
    +33 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
  17. Claudemir

    Claudemir Member Gold Contributor

    Joined:
    Oct 22, 2012
    Messages:
    168
    Balance:
    49Coins
    Ratings:
    +33 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    friend! @TOPMO3
    that mistake and this? upload_2016-7-5_17-8-5.png
    Arduino: 1.6.9 (Windows 7), Placa:"Arduino/Genuino Micro"

    C:\Users\Usuario\AppData\Local\Temp\arduino_modified_sketch_295951\sketch_jul05b.ino: In function 'void setup()':

    sketch_jul05b:93: error: 'Joystick' was not declared in this scope

    Joystick.begin();

    ^

    C:\Users\Usuario\AppData\Local\Temp\arduino_modified_sketch_295951\sketch_jul05b.ino: In function 'void CheckAllButtons()':

    sketch_jul05b:111: error: 'Joystick' was not declared in this scope

    Joystick.setButton(key, 1); delay(50); Joystick.setButton(key, 0);

    ^

    C:\Users\Usuario\AppData\Local\Temp\arduino_modified_sketch_295951\sketch_jul05b.ino: In function 'void CheckAllEncoders()':

    sketch_jul05b:144: error: 'Joystick' was not declared in this scope

    Joystick.setButton(rotaries.ccwchar, 1); delay(50); Joystick.setButton(rotaries.ccwchar, 0);

    ^

    sketch_jul05b:147: error: 'Joystick' was not declared in this scope

    Joystick.setButton(rotaries.cwchar, 1); delay(50); Joystick.setButton(rotaries.cwchar, 0);

    ^

    exit status 1
    'Joystick' was not declared in this scope

    Este relatório teria mais informações com
    "Mostrar a saida detalhada durante a compilação"
    opção pode ser ativada em "Arquivo -> Preferências"
    upload_2016-7-5_17-8-5.png
  18. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
  19. Claudemir

    Claudemir Member Gold Contributor

    Joined:
    Oct 22, 2012
    Messages:
    168
    Balance:
    49Coins
    Ratings:
    +33 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    @TOPMO3 I found my mistake!:cheers
    I was putting the wrong library file!
    when you dawloand the link above, contained two types of archive joystik Version2.
    this is not compatible file!
    thank you for your work.hug:
    now so I would ask that I could use this code with 3 potentiometers,accelerator and brake clutch please:sos
  20. Claudemir

    Claudemir Member Gold Contributor

    Joined:
    Oct 22, 2012
    Messages:
    168
    Balance:
    49Coins
    Ratings:
    +33 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    @TOPMO3
    you can use 4 button off / on in your button1 project?
    I would like to stay 4 buttons actuated with the off / on switch.