I'm Tired and ready for bed... with my Arduino and servo's

polarMike Jan 20, 2022

  1. polarMike

    polarMike TrainBoard Member

    11
    0
    13
    So, I've been able to push a button and it turns one LED off, a servo moves my turnout one way and then other LED goes on... and when I push the button again, it moves it back. Great. It's like magic.

    But I want to do this for 4 different servo's, and a part of me says just create a loop... ah yes... the mighty loop... But wait... an ARRAY is how it should be done... I'm a hardware person, not a s/w genius. And there seems to be a couple of different way to do this with software, "just look at what other people have coded..." .... everyone does it different... whaaaa?, and then there's no schematic when I find what I want.

    I'm using a UNO, push buttons and LED's, one for straight and one LED for path for divergent path. I've been able to get a bunch of different peoples code to work partway, but when I ask for a schematic to wire up my hardware... ha, it's on my website somewhere they say.. go find it.

    Anyone have a sketch I can steal and a photo of their schematic?... I'm tired and just wanna go to bed.
     
  2. chinapig

    chinapig TrainBoard Member

    137
    18
    19
    Ok, I like an easy life and I've tried with Arduinos and partially succeeded but forgotten everything I taught myself. But then I discovered the DCCNext.
    https://www.arcomora.com/
    The software makes Arduino programming as easy as answering multichoice questions. I'm using loads of them for servos. They can also be programmed to do a lot of other things. It may be worth giving them a go.

    Cheers, Ted
     
  3. BigJake

    BigJake TrainBoard Member

    3,296
    6,327
    70
    Just try things different ways you've seen them online, and pick the way you like/understand best. Different people have different ways they like to attack a problem in code. There are some ways that are "better" than others (especially when it comes to maintaining, modifying, and/or expanding the code,) but by and large, they all work.
     
  4. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    coding can be a very personal thing, and there is is many way to get an acceptable result .... just pick whatever way looks the best to you ...
     

Share This Page