<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Arduino Coding for a Turntable	</title>
	<atom:link href="https://blog.model-train-help.com/2021/10/arduino-coding-for-a-turntable.html/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.model-train-help.com/2021/10/arduino-coding-for-a-turntable.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=arduino-coding-for-a-turntable</link>
	<description>Model railroads and model trains</description>
	<lastBuildDate>Sun, 03 Sep 2023 01:29:20 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: kenneth durham		</title>
		<link>https://blog.model-train-help.com/2021/10/arduino-coding-for-a-turntable.html#comment-63543</link>

		<dc:creator><![CDATA[kenneth durham]]></dc:creator>
		<pubDate>Sun, 03 Sep 2023 01:29:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.model-train-help.com/?p=6237#comment-63543</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://blog.model-train-help.com/2021/10/arduino-coding-for-a-turntable.html#comment-54578&quot;&gt;Nigel&lt;/a&gt;.

Nigel.
I am trying to upgrade my turntable using similar techniques to those shown in the tread attached to your transmission of Oct 6 2021. My browser will not open the various JPG files attached to the instructions. I get a message -&quot;This XML file does not appear to have any style information associated with it. Can you assist in proividing copies of the various JPG files or direct me to where I might obtain same
Regards, Ken]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://blog.model-train-help.com/2021/10/arduino-coding-for-a-turntable.html#comment-54578">Nigel</a>.</p>
<p>Nigel.<br />
I am trying to upgrade my turntable using similar techniques to those shown in the tread attached to your transmission of Oct 6 2021. My browser will not open the various JPG files attached to the instructions. I get a message -&#8220;This XML file does not appear to have any style information associated with it. Can you assist in proividing copies of the various JPG files or direct me to where I might obtain same<br />
Regards, Ken</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: The N-Scale Nerd		</title>
		<link>https://blog.model-train-help.com/2021/10/arduino-coding-for-a-turntable.html#comment-54582</link>

		<dc:creator><![CDATA[The N-Scale Nerd]]></dc:creator>
		<pubDate>Wed, 06 Oct 2021 10:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.model-train-help.com/?p=6237#comment-54582</guid>

					<description><![CDATA[Oh..Sorry. That looks terrible!
Perhaps the file...See attached

By the way , it was the Arduino, XC-4458, 5V Stepper Motor + Controller

I was hooking up to a PECO NB-55 (N-guage) table, and I ended up using a length of LEGO Technic shaft glued into the turntable rotor to make the connection possible. I see you&#039;re in OO, so you&#039;ll have to figure out a way to hook your table up.]]></description>
			<content:encoded><![CDATA[<p>Oh..Sorry. That looks terrible!<br />
Perhaps the file&#8230;See attached</p>
<p>By the way , it was the Arduino, XC-4458, 5V Stepper Motor + Controller</p>
<p>I was hooking up to a PECO NB-55 (N-guage) table, and I ended up using a length of LEGO Technic shaft glued into the turntable rotor to make the connection possible. I see you&#8217;re in OO, so you&#8217;ll have to figure out a way to hook your table up.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: The N-Scale Nerd		</title>
		<link>https://blog.model-train-help.com/2021/10/arduino-coding-for-a-turntable.html#comment-54581</link>

		<dc:creator><![CDATA[The N-Scale Nerd]]></dc:creator>
		<pubDate>Wed, 06 Oct 2021 10:02:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.model-train-help.com/?p=6237#comment-54581</guid>

					<description><![CDATA[If you&#039;re using the Arduino, Stepper-motor module, I tweaked the code to include a FWD and REV button to manually swing the table. You&#039;ll have the stepper.h file in the Arduino library.
For your application you&#039;ll have to include an input for your Hall Effect sensor, too.
The other issue is to find the right shaft-coupler for the turntable. The diameter of the Arduino stepper motor is 5mm.
Here&#039;s the code...

//FORWARD/REVERSE Control of Stepper Motor - Rev XX
//26/3/2020 - Use Rubber coupler to motor. (StepsperRev set to 10)
//24/4/2020 - Use Lego gears to motor.   (StepsperRev set to 64)
//27/04/2020 - Found a plastic shaft-coupler - Works a treat!
//26/05/2020 - Change StepsPerRev to 5


#include 

// Constants used to set pin numbers:
const int CWbuttonPin = 2;     // the number of the Clock-wise pushbutton pin
const int ACWbuttonPin = 3;     // the number of the Anti-Clock-wise pushbutton pin

const int stepsPerRevolution = 5;   // 10 - Gives ~10 degrees;64;200;change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);  //NOT 8, 9, 10, 11 as shown in examples!!!

// variables will change:
int CWbuttonState = 0;         // variable for reading the pushbutton status
int ACWbuttonState = 0;         // variable for reading the pushbutton status


void setup() {
  // put your setup code here, to run once:
  pinMode(CWbuttonPin, INPUT);
  pinMode(ACWbuttonPin, INPUT);
  
 // set the speed at 200 rpm:
  myStepper.setSpeed(200); //60 initially
}

void loop() {
  // Here&#039;s the main code, to run repeatedly:

//Clockwise Push-button code
  // read the state of the CWpushbutton value:
  CWbuttonState = digitalRead(CWbuttonPin);

  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (CWbuttonState == HIGH) {
   
     myStepper.step(stepsPerRevolution);//Rotate clockwise
 
  } else {
    CWbuttonState = 0;
  }
 
 //Anti-Clockwise Push-button code
   ACWbuttonState = digitalRead(ACWbuttonPin);

  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (ACWbuttonState == HIGH) {
   
     myStepper.step(-stepsPerRevolution);//Rotate anti-clockwise
 
  } else {
    ACWbuttonState = 0; 
    }
  
}]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using the Arduino, Stepper-motor module, I tweaked the code to include a FWD and REV button to manually swing the table. You&#8217;ll have the stepper.h file in the Arduino library.<br />
For your application you&#8217;ll have to include an input for your Hall Effect sensor, too.<br />
The other issue is to find the right shaft-coupler for the turntable. The diameter of the Arduino stepper motor is 5mm.<br />
Here&#8217;s the code&#8230;</p>
<p>//FORWARD/REVERSE Control of Stepper Motor &#8211; Rev XX<br />
//26/3/2020 &#8211; Use Rubber coupler to motor. (StepsperRev set to 10)<br />
//24/4/2020 &#8211; Use Lego gears to motor.   (StepsperRev set to 64)<br />
//27/04/2020 &#8211; Found a plastic shaft-coupler &#8211; Works a treat!<br />
//26/05/2020 &#8211; Change StepsPerRev to 5</p>
<p>#include </p>
<p>// Constants used to set pin numbers:<br />
const int CWbuttonPin = 2;     // the number of the Clock-wise pushbutton pin<br />
const int ACWbuttonPin = 3;     // the number of the Anti-Clock-wise pushbutton pin</p>
<p>const int stepsPerRevolution = 5;   // 10 &#8211; Gives ~10 degrees;64;200;change this to fit the number of steps per revolution<br />
// for your motor</p>
<p>// initialize the stepper library on pins 8 through 11:<br />
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);  //NOT 8, 9, 10, 11 as shown in examples!!!</p>
<p>// variables will change:<br />
int CWbuttonState = 0;         // variable for reading the pushbutton status<br />
int ACWbuttonState = 0;         // variable for reading the pushbutton status</p>
<p>void setup() {<br />
  // put your setup code here, to run once:<br />
  pinMode(CWbuttonPin, INPUT);<br />
  pinMode(ACWbuttonPin, INPUT);</p>
<p> // set the speed at 200 rpm:<br />
  myStepper.setSpeed(200); //60 initially<br />
}</p>
<p>void loop() {<br />
  // Here&#8217;s the main code, to run repeatedly:</p>
<p>//Clockwise Push-button code<br />
  // read the state of the CWpushbutton value:<br />
  CWbuttonState = digitalRead(CWbuttonPin);</p>
<p>  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:<br />
  if (CWbuttonState == HIGH) {</p>
<p>     myStepper.step(stepsPerRevolution);//Rotate clockwise</p>
<p>  } else {<br />
    CWbuttonState = 0;<br />
  }</p>
<p> //Anti-Clockwise Push-button code<br />
   ACWbuttonState = digitalRead(ACWbuttonPin);</p>
<p>  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:<br />
  if (ACWbuttonState == HIGH) {</p>
<p>     myStepper.step(-stepsPerRevolution);//Rotate anti-clockwise</p>
<p>  } else {<br />
    ACWbuttonState = 0;<br />
    }</p>
<p>}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Nigel		</title>
		<link>https://blog.model-train-help.com/2021/10/arduino-coding-for-a-turntable.html#comment-54578</link>

		<dc:creator><![CDATA[Nigel]]></dc:creator>
		<pubDate>Wed, 06 Oct 2021 08:00:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.model-train-help.com/?p=6237#comment-54578</guid>

					<description><![CDATA[There is an absolutely brilliant thread on RMWeb that deals with this very issue.  He covers both the motorisation of the turntable using a stepper motor, using the hall sensor for alignment and then a step by step explanation of the arduino code which culminates in controlling the whole thing via DCC.  Even if this doesn&#039;t give you exactly the code you need for your particular setup, by the time you&#039;ve gone through it you&#039;ll have such a good understanding that you&#039;ll know exactly how to make the amendments you need.

You&#039;ll find the thread here:

https://www.rmweb.co.uk/community/index.php?/topic/78578-dcc-controlled-peco-turntable-project-using-a-arduino-uno/

Good luck!]]></description>
			<content:encoded><![CDATA[<p>There is an absolutely brilliant thread on RMWeb that deals with this very issue.  He covers both the motorisation of the turntable using a stepper motor, using the hall sensor for alignment and then a step by step explanation of the arduino code which culminates in controlling the whole thing via DCC.  Even if this doesn&#8217;t give you exactly the code you need for your particular setup, by the time you&#8217;ve gone through it you&#8217;ll have such a good understanding that you&#8217;ll know exactly how to make the amendments you need.</p>
<p>You&#8217;ll find the thread here:</p>
<p><a href="https://www.rmweb.co.uk/community/index.php?/topic/78578-dcc-controlled-peco-turntable-project-using-a-arduino-uno/" rel="nofollow ugc">https://www.rmweb.co.uk/community/index.php?/topic/78578-dcc-controlled-peco-turntable-project-using-a-arduino-uno/</a></p>
<p>Good luck!</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
