<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>InitialCode &amp;mdash; Paul Sutton</title>
    <link>https://paper.wf/paulsutton/tag:InitialCode</link>
    <description>Paul Sutton - personal blog </description>
    <pubDate>Thu, 07 May 2026 00:37:32 +0000</pubDate>
    <item>
      <title>Code Club Electronics 18</title>
      <link>https://paper.wf/paulsutton/code-club-electronics-18</link>
      <description>&lt;![CDATA[Code Club Electronics 18&#xA;&#xA;I was intending to use a potentiometer to control the motor speed, however using an arduino seems rather overkill for this.   So I will just do that directly.  &#xA;&#xA;I decided to build a car instead,  so far this has 2 wheels and just goes forward. &#xA;&#xA;include AFMotor.h&#xA;&#xA;AFDCMotor motorA(3);&#xA;AFDCMotor motorB(4);&#xA;/&#xA; Created by ArduinoGetStarted.com&#xA;  This example code is in the public domain&#xA;  Tutorial page: https://arduinogetstarted.com/tutorials/arduino-potentiometer&#xA; /&#xA;&#xA;// the setup routine runs once when you press reset:&#xA;void setup() {&#xA;  // initialize serial communication at 9600 bits per second:&#xA;  //Serial.begin(9600);&#xA;  motorA.setSpeed(100);&#xA;  motorA.run(RELEASE);&#xA;  motorB.setSpeed(100);&#xA;  motorB.run(RELEASE);&#xA;}&#xA;&#xA;// the loop routine runs over and over again forever:&#xA;void loop() {&#xA;&#xA;  &#xA;  &#xA;//Motor spinning clockwise&#xA;  motorA.run(FORWARD);&#xA;  //Speed up&#xA;  motorA.setSpeed(100);  &#xA;  motorB.run(FORWARD);&#xA;  //Speed up&#xA;  motorB.setSpeed(100); &#xA;    &#xA;&#xA;  }&#xA;  &#xA;&#xA;#Arduino,#Robot,#Car,#InitialCode  &#xA;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Code Club Electronics 18</p>

<p>I was intending to use a potentiometer to control the motor speed, however using an arduino seems rather overkill for this.   So I will just do that directly.</p>

<p>I decided to build a car instead,  so far this has 2 wheels and just goes forward.</p>

<pre><code>#include &lt;AFMotor.h&gt;

AF_DCMotor motorA(3);
AF_DCMotor motorB(4);
/*
 * Created by ArduinoGetStarted.com
 *
 * This example code is in the public domain
 *
 * Tutorial page: https://arduinogetstarted.com/tutorials/arduino-potentiometer
 */



// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  //Serial.begin(9600);
  motorA.setSpeed(100);
  motorA.run(RELEASE);
  motorB.setSpeed(100);
  motorB.run(RELEASE);
}

// the loop routine runs over and over again forever:
void loop() {

  
  
//Motor spinning clockwise
  motorA.run(FORWARD);
  //Speed up
  motorA.setSpeed(100);  
  motorB.run(FORWARD);
  //Speed up
  motorB.setSpeed(100); 
    


  }
  
</code></pre>

<p><a href="/paulsutton/tag:Arduino" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Arduino</span></a>,<a href="/paulsutton/tag:Robot" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Robot</span></a>,<a href="/paulsutton/tag:Car" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Car</span></a>,<a href="/paulsutton/tag:InitialCode" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">InitialCode</span></a></p>
]]></content:encoded>
      <guid>https://paper.wf/paulsutton/code-club-electronics-18</guid>
      <pubDate>Fri, 05 Jan 2024 20:52:39 +0000</pubDate>
    </item>
  </channel>
</rss>