N Gauge Forum

Your Layout and Models => Electronics => Topic started by: Firstone18 on October 30, 2019, 03:51:29 PM

Title: Arduino code required please
Post by: Firstone18 on October 30, 2019, 03:51:29 PM
 :helpneededsign:
I recently saw a YT video from Proto-Pic demonstrating a turntable controller using a Arduino and stepper motor. I have contacted Proto-Pic, and unfortunately the person who had the code no longer has it. Can anyone help with this please? If there is someone who can re-create, or even suggest a better code for TT control, please let me know. Thanks!

 :thankyousign:
have looked at all responses, and think I am now sorted.
thanks to all for you guidance.
Title: Re: Arduino code required please
Post by: Railwaygun on October 30, 2019, 04:28:05 PM
Do a seaech on “Arduino turntable” on NGF  and you will find lots of info
Title: Re: Arduino code required please
Post by: NinOz on November 04, 2019, 05:14:57 AM
Here:
https://www.rmweb.co.uk/community/index.php?/topic/78578-dcc-controlled-peco-turntable-project-using-a-arduino-uno/&tab=comments#comment-1223686 (https://www.rmweb.co.uk/community/index.php?/topic/78578-dcc-controlled-peco-turntable-project-using-a-arduino-uno/&tab=comments#comment-1223686)
Title: Re: Arduino code required please
Post by: N_GaugeModeller on November 04, 2019, 08:42:53 AM
I built this one

http://www.modeltraincatalogue.com/turntable2.html (http://www.modeltraincatalogue.com/turntable2.html)

It's quite a simple build with no sensors needed and used a remote control to move.

Seemed to work well, although I did eventually replace it with the MERG version which was better for my application needs.

Title: Re: Arduino code required please
Post by: Bealman on November 04, 2019, 09:58:14 AM
Yes, there are heaps out there.

Certainly no need to write your own code.

Do what most people do.... take an existing proven code and modify it to suit your own needs!
Title: Re: Arduino code required please
Post by: njee20 on November 04, 2019, 11:07:42 AM
To be fair, that's exactly what he's doing, as asking for advice on that!

Google is awash with solutions, which I'm disinclined to wade through, I was drawn to the thread NinOz has linked to, looks pretty comprehensive, I imagine the sketch is in there somewhere!
Title: Re: Arduino code required please
Post by: Vonzack on November 04, 2019, 12:40:20 PM
From memory it is, there are a couple of versions of it, but it's early on in the thread.
Title: Re: Arduino code required please
Post by: jthjth on November 04, 2019, 04:10:00 PM
Not quite what you asked, but have a look here https://www.dccinterface.com/product/model-railway-premium-dcc-turntable-controller-kit-direct-mount/ (https://www.dccinterface.com/product/model-railway-premium-dcc-turntable-controller-kit-direct-mount/)

I was about to go down the diy Arduino route, but this saved me all the effort. You get the source code as well. The kit works really well, and with the addition of a keypad it will work on DC as well as DCC. What I like about the approach in this kit is that all the information about the number of tracks, and their angles, is held in a simple text file on an SD card. You don't need to have any programming knowledge to set it up, just the ability to edit a text file.
SimplePortal 2.3.5 © 2008-2012, SimplePortal