<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>robot &amp;mdash; Paul Sutton</title>
    <link>https://personaljournal.ca/paulsutton/tag:robot</link>
    <description>Personal Blog</description>
    <pubDate>Tue, 05 May 2026 16:34:15 +0000</pubDate>
    <item>
      <title>Code Club Electronics 18</title>
      <link>https://personaljournal.ca/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;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#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>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/code-club-electronics-18</guid>
      <pubDate>Fri, 05 Jan 2024 20:52:39 +0000</pubDate>
    </item>
  </channel>
</rss>