<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.cqrobot.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yangguo</id>
		<title>CQRobot-Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.cqrobot.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Yangguo"/>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php/Special:Contributions/Yangguo"/>
		<updated>2026-04-05T16:56:07Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1669</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1669"/>
				<updated>2018-04-03T10:56:54Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* INTRODUCTION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
This is a DC motor with retarder and encoder, Driving voltage is 6V-12V, Gear ratio  is 168:1, The motor comes with a Hall-type coding system, Which outputs 16 pulses per loop, Single output 2688 pulses per revolution. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
'''Single Output 2688 Pulses Per Revolution:'''&lt;br /&gt;
&lt;br /&gt;
*Gear Ratio: 168:1&lt;br /&gt;
*Each Loop Output Pulses: 16&lt;br /&gt;
*168 * 16=2688&lt;br /&gt;
&lt;br /&gt;
The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR. Phase difference 90 degrees.&lt;br /&gt;
&lt;br /&gt;
These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 6V / 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
At 250V DC between motor terminal &amp;amp; housing: 20 M Ω min.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Motor Size'''&lt;br /&gt;
 {|-&lt;br /&gt;
|[[File:Motor8.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Connect the Renderings'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1668</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1668"/>
				<updated>2018-04-03T10:53:17Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* INTRODUCTION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
This is a DC motor with retarder and encoder, Driving voltage is 6V-12V, Gear ratio  is 168:1, The motor comes with a Hall-type coding system, Which outputs 16 pulses per loop, Single output 2688 pulses per revolution. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Motor Size'''&lt;br /&gt;
 {|-&lt;br /&gt;
|[[File:Motor8.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Connect the Renderings'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1667</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1667"/>
				<updated>2018-04-03T10:40:16Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* INTRODUCTION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Motor Size'''&lt;br /&gt;
 {|-&lt;br /&gt;
|[[File:Motor8.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Connect the Renderings'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1661</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1661"/>
				<updated>2018-04-02T13:07:39Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* DISPLAY */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Motor Size'''&lt;br /&gt;
 {|-&lt;br /&gt;
|[[File:Motor8.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Connect the Renderings'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1660</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1660"/>
				<updated>2018-04-02T13:06:06Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* DISPLAY */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|250px]]&lt;br /&gt;
|[[File:GLDJ-10.jpg |none|250px]]&lt;br /&gt;
|[[File:GLDJ-11.jpg |none|250px]]&lt;br /&gt;
|[[File:GLDJ-12.jpg |none|250px]]&lt;br /&gt;
|[[File:GLDJ-13.jpg |none|250px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Motor Size'''&lt;br /&gt;
 {|-&lt;br /&gt;
|[[File:Motor8.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Connect the Renderings'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1659</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1659"/>
				<updated>2018-04-02T13:05:28Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* DISPLAY */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|250px]]&lt;br /&gt;
|[[File:GLDJ-10.jpg |none|250px]]&lt;br /&gt;
|[[File:GLDJ-11.jpg |none|250px]]&lt;br /&gt;
|[[File:GLDJ-12.jpg |none|250px]]&lt;br /&gt;
|[[File:GLDJ-13.jpg |none|250px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Motor Size'''&lt;br /&gt;
 {|-&lt;br /&gt;
|[[File:Motor8.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Connect the Renderings'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:GLDJ-10.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-11.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-12.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-13.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1658</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1658"/>
				<updated>2018-04-02T13:04:36Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* INTRODUCTION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:GLDJ-10.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-11.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-12.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-13.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Motor Size'''&lt;br /&gt;
 {|-&lt;br /&gt;
|[[File:Motor8.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Connect the Renderings'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:GLDJ-10.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-11.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-12.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-13.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=File:GLDJ-13.jpg&amp;diff=1657</id>
		<title>File:GLDJ-13.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=File:GLDJ-13.jpg&amp;diff=1657"/>
				<updated>2018-04-02T13:02:44Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=File:GLDJ-12.jpg&amp;diff=1656</id>
		<title>File:GLDJ-12.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=File:GLDJ-12.jpg&amp;diff=1656"/>
				<updated>2018-04-02T13:02:19Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=File:GLDJ-11.jpg&amp;diff=1655</id>
		<title>File:GLDJ-11.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=File:GLDJ-11.jpg&amp;diff=1655"/>
				<updated>2018-04-02T13:01:59Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=File:GLDJ-10.jpg&amp;diff=1654</id>
		<title>File:GLDJ-10.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=File:GLDJ-10.jpg&amp;diff=1654"/>
				<updated>2018-04-02T13:01:32Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1653</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1653"/>
				<updated>2018-04-02T12:59:12Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* DISPLAY */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Motor Size'''&lt;br /&gt;
 {|-&lt;br /&gt;
|[[File:Motor8.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Connect the Renderings'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:GLDJ-10.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-11.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-12.jpg |none|300px]]&lt;br /&gt;
|[[File:GLDJ-13.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1652</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1652"/>
				<updated>2018-04-02T12:42:25Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* DISPLAY */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Motor Size'''&lt;br /&gt;
 {|-&lt;br /&gt;
|[[File:Motor8.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Connect the Renderings'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1651</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1651"/>
				<updated>2018-04-02T12:40:10Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Motor Size'''&lt;br /&gt;
 {|-&lt;br /&gt;
|[[File:Motor8.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Connect the Renderings'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1650</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1650"/>
				<updated>2018-04-02T11:43:12Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Motor Size'''&lt;br /&gt;
 {|-&lt;br /&gt;
|[[File:Motor8.jpg |left|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1649</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1649"/>
				<updated>2018-04-02T11:36:53Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* DISPLAY */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1648</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1648"/>
				<updated>2018-04-02T10:58:24Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
&lt;br /&gt;
'''See the link for detail''' http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1647</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1647"/>
				<updated>2018-04-02T10:56:45Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
'''''Interrupt Port with Different Board'''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:''''' attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1646</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1646"/>
				<updated>2018-04-02T10:55:37Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Encoder Sample Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1645</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1645"/>
				<updated>2018-04-02T10:54:58Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
'''Encoder Sample Code'''&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
=='''Encoder Sample Code'''== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1644</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1644"/>
				<updated>2018-04-02T10:52:50Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Encoder Sample Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
=='''Encoder Sample Code'''== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1643</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1643"/>
				<updated>2018-04-02T10:51:26Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|600px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
=='''Encoder Sample Code'''== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:nextredirectltr.png]]Go Shopping [http://www.dfrobot.com.cn/goods-1064.html 12V 直流减速电机 122rpm 带编码器(SKU: FIT0403)]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[category: Product Manual]]&lt;br /&gt;
[[category: FIT Series]]&lt;br /&gt;
[[category: Motor]]&lt;br /&gt;
&amp;lt;!--Hidden Categories--!&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1642</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1642"/>
				<updated>2018-04-02T10:49:37Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* 样例代码 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|500px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
=='''Encoder Sample Code'''== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:nextredirectltr.png]]Go Shopping [http://www.dfrobot.com.cn/goods-1064.html 12V 直流减速电机 122rpm 带编码器(SKU: FIT0403)]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[category: Product Manual]]&lt;br /&gt;
[[category: FIT Series]]&lt;br /&gt;
[[category: Motor]]&lt;br /&gt;
&amp;lt;!--Hidden Categories--!&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1641</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1641"/>
				<updated>2018-04-02T10:46:43Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|500px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
==样例代码== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:nextredirectltr.png]]Go Shopping [http://www.dfrobot.com.cn/goods-1064.html 12V 直流减速电机 122rpm 带编码器(SKU: FIT0403)]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[category: Product Manual]]&lt;br /&gt;
[[category: FIT Series]]&lt;br /&gt;
[[category: Motor]]&lt;br /&gt;
&amp;lt;!--Hidden Categories--!&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1640</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1640"/>
				<updated>2018-04-02T10:46:01Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|500px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
==样例代码== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:nextredirectltr.png]]Go Shopping [http://www.dfrobot.com.cn/goods-1064.html 12V 直流减速电机 122rpm 带编码器(SKU: FIT0403)]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[category: Product Manual]]&lt;br /&gt;
[[category: FIT Series]]&lt;br /&gt;
[[category: Motor]]&lt;br /&gt;
&amp;lt;!--Hidden Categories--!&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=File:CQR-7.jpg&amp;diff=1639</id>
		<title>File:CQR-7.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=File:CQR-7.jpg&amp;diff=1639"/>
				<updated>2018-04-02T10:45:11Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1638</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1638"/>
				<updated>2018-04-02T10:44:56Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:CQR-7.jpg|thumb|700px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
==样例代码== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:nextredirectltr.png]]Go Shopping [http://www.dfrobot.com.cn/goods-1064.html 12V 直流减速电机 122rpm 带编码器(SKU: FIT0403)]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[category: Product Manual]]&lt;br /&gt;
[[category: FIT Series]]&lt;br /&gt;
[[category: Motor]]&lt;br /&gt;
&amp;lt;!--Hidden Categories--!&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1637</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1637"/>
				<updated>2018-04-02T10:41:54Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for Arduino&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:|thumb|700px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
==样例代码== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:nextredirectltr.png]]Go Shopping [http://www.dfrobot.com.cn/goods-1064.html 12V 直流减速电机 122rpm 带编码器(SKU: FIT0403)]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[category: Product Manual]]&lt;br /&gt;
[[category: FIT Series]]&lt;br /&gt;
[[category: Motor]]&lt;br /&gt;
&amp;lt;!--Hidden Categories--!&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1636</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1636"/>
				<updated>2018-04-02T10:41:12Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|300px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:|thumb|700px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
==样例代码== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:nextredirectltr.png]]Go Shopping [http://www.dfrobot.com.cn/goods-1064.html 12V 直流减速电机 122rpm 带编码器(SKU: FIT0403)]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[category: Product Manual]]&lt;br /&gt;
[[category: FIT Series]]&lt;br /&gt;
[[category: Motor]]&lt;br /&gt;
&amp;lt;!--Hidden Categories--!&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1635</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1635"/>
				<updated>2018-04-02T10:40:53Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|200px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:|thumb|700px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
==样例代码== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:nextredirectltr.png]]Go Shopping [http://www.dfrobot.com.cn/goods-1064.html 12V 直流减速电机 122rpm 带编码器(SKU: FIT0403)]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[category: Product Manual]]&lt;br /&gt;
[[category: FIT Series]]&lt;br /&gt;
[[category: Motor]]&lt;br /&gt;
&amp;lt;!--Hidden Categories--!&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1634</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1634"/>
				<updated>2018-04-02T10:40:30Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for UNO&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|400px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:|thumb|700px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
==样例代码== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:nextredirectltr.png]]Go Shopping [http://www.dfrobot.com.cn/goods-1064.html 12V 直流减速电机 122rpm 带编码器(SKU: FIT0403)]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[category: Product Manual]]&lt;br /&gt;
[[category: FIT Series]]&lt;br /&gt;
[[category: Motor]]&lt;br /&gt;
&amp;lt;!--Hidden Categories--!&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=File:GLDJ-6.jpg&amp;diff=1633</id>
		<title>File:GLDJ-6.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=File:GLDJ-6.jpg&amp;diff=1633"/>
				<updated>2018-04-02T10:39:00Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1632</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1632"/>
				<updated>2018-04-02T10:38:47Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for UNO&lt;br /&gt;
[[image:FIT0403 encoder.png|thumb|400px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:GLDJ-6.jpg|thumb|700px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
==样例代码== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:nextredirectltr.png]]Go Shopping [http://www.dfrobot.com.cn/goods-1064.html 12V 直流减速电机 122rpm 带编码器(SKU: FIT0403)]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[category: Product Manual]]&lt;br /&gt;
[[category: FIT Series]]&lt;br /&gt;
[[category: Motor]]&lt;br /&gt;
&amp;lt;!--Hidden Categories--!&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1631</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1631"/>
				<updated>2018-04-02T10:37:37Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
Diagram for UNO&lt;br /&gt;
[[image:FIT0403 encoder.png|thumb|400px| center]]&lt;br /&gt;
&lt;br /&gt;
===='''''Interrupt Port with Different Board===='''''&lt;br /&gt;
&lt;br /&gt;
'''''Notcie:'''''attachInterrupt()&lt;br /&gt;
[[image:GLDJ-6|thumb|700px|center]]&lt;br /&gt;
For example,with arduino UNO board, you want to use interrupt port 0(int.0). You should connect digital pin 2 with the board. So, the&lt;br /&gt;
following code is only used in UNO and Mega2560. If you want to use arduino Leonardo or Romeo, you should change digital pin 3&lt;br /&gt;
instead of digital pin 2.&lt;br /&gt;
See the link for detail http://arduino.cc/en/Reference/AttachInterrupt&lt;br /&gt;
&lt;br /&gt;
==样例代码== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//The sample code for driving one way motor encoder&lt;br /&gt;
const byte encoder0pinA = 2;//A pin -&amp;gt; the interrupt pin 0&lt;br /&gt;
const byte encoder0pinB = 4;//B pin -&amp;gt; the digital pin 4&lt;br /&gt;
byte encoder0PinALast;&lt;br /&gt;
int duration;//the number of the pulses&lt;br /&gt;
boolean Direction;//the rotation direction &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
void setup()&lt;br /&gt;
{  &lt;br /&gt;
  Serial.begin(57600);//Initialize the serial port&lt;br /&gt;
  EncoderInit();//Initialize the module&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  Serial.print(&amp;quot;Pulse:&amp;quot;);&lt;br /&gt;
  Serial.println(duration);&lt;br /&gt;
  duration = 0;&lt;br /&gt;
  delay(100);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void EncoderInit()&lt;br /&gt;
{&lt;br /&gt;
  Direction = true;//default -&amp;gt; Forward  &lt;br /&gt;
  pinMode(encoder0pinB,INPUT);  &lt;br /&gt;
  attachInterrupt(0, wheelSpeed, CHANGE);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void wheelSpeed()&lt;br /&gt;
{&lt;br /&gt;
  int Lstate = digitalRead(encoder0pinA);&lt;br /&gt;
  if((encoder0PinALast == LOW) &amp;amp;&amp;amp; Lstate==HIGH)&lt;br /&gt;
  {&lt;br /&gt;
    int val = digitalRead(encoder0pinB);&lt;br /&gt;
    if(val == LOW &amp;amp;&amp;amp; Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = false; //Reverse&lt;br /&gt;
    }&lt;br /&gt;
    else if(val == HIGH &amp;amp;&amp;amp; !Direction)&lt;br /&gt;
    {&lt;br /&gt;
      Direction = true;  //Forward&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  encoder0PinALast = Lstate;&lt;br /&gt;
 &lt;br /&gt;
  if(!Direction)  duration++;&lt;br /&gt;
  else  duration--;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[image:nextredirectltr.png]]Go Shopping [http://www.dfrobot.com.cn/goods-1064.html 12V 直流减速电机 122rpm 带编码器(SKU: FIT0403)]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[category: Product Manual]]&lt;br /&gt;
[[category: FIT Series]]&lt;br /&gt;
[[category: Motor]]&lt;br /&gt;
&amp;lt;!--Hidden Categories--!&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1630</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1630"/>
				<updated>2018-04-02T10:28:54Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* SPECIFICATION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
'''Encoder Diagram'''&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1629</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1629"/>
				<updated>2018-04-02T10:22:49Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* DISTRIBUTION LIST */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1628</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1628"/>
				<updated>2018-04-02T10:22:03Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Display */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''DISPLAY'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1627</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1627"/>
				<updated>2018-04-02T10:21:14Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Specification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''SPECIFICATION'''==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''Display'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1626</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1626"/>
				<updated>2018-04-02T10:20:30Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
=='''INTRODUCTION'''==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''Display'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1625</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1625"/>
				<updated>2018-04-02T10:19:50Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Display */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=='''Display'''==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1624</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1624"/>
				<updated>2018-04-02T10:19:10Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Specification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|600px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|600px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1623</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1623"/>
				<updated>2018-04-02T10:18:49Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Specification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|700px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|700px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1620</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1620"/>
				<updated>2018-04-02T10:17:54Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Specification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
'''Metal DC Geared Motor'''&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|500px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|500px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1619</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1619"/>
				<updated>2018-04-02T10:13:51Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Motor Encoder */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
'''Motor Encoder'''&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|500px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|500px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1618</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1618"/>
				<updated>2018-04-02T10:13:14Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Specification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
==Motor Encoder==&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|500px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|500px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1617</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1617"/>
				<updated>2018-04-02T10:04:51Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|500px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|500px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1616</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1616"/>
				<updated>2018-04-02T10:04:30Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* DISTRIBUTION LIST */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|500px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|500px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==code==&lt;br /&gt;
jkyuk&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1615</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1615"/>
				<updated>2018-04-02T10:02:21Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Specification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|500px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|500px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1614</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1614"/>
				<updated>2018-04-02T10:01:44Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Specification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|500px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|500px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor20.jpg |left|500px]]&lt;br /&gt;
|[[File:Motor21.jpg |none|500px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	<entry>
		<id>http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1613</id>
		<title>Metal DC Geared Motor w/Encoder CQGB37Y001</title>
		<link rel="alternate" type="text/html" href="http://www.cqrobot.wiki/index.php?title=Metal_DC_Geared_Motor_w/Encoder_CQGB37Y001&amp;diff=1613"/>
				<updated>2018-04-02T10:00:20Z</updated>
		
		<summary type="html">&lt;p&gt;Yangguo: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Motor1.jpg| right |thumb|400px|6V/12V Metal DC Geared Motor w/Encoder-CQRDJ-GL]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
*'''Supports 6V and 12V Operating Voltage.'''&lt;br /&gt;
*This is metal DC geared motor w/Encoder, Operating voltage is 6V-12V. for Projects Such as Robot, Custom Servo, Arduino and 3D Printers.&lt;br /&gt;
&lt;br /&gt;
*The rear of the motor is equipped with a dual channel Holzer effect encoder, AB dual output, single circuit per cycle pulse 16CPR, double down the road, a total output of 64CPR.&lt;br /&gt;
&lt;br /&gt;
*These units have a 0.61 inch long, 6 mm(0.24 inch)-diameter D-shaped output shaft. This motor is intended for use at 12V, though the motor can begin rotating at voltages as low as 1V.&lt;br /&gt;
&lt;br /&gt;
*The face plate has six mounting holes evenly spaced around the outer edge threaded for M3 screws. These mounting holes form a regular hexagon and the centers of neighboring holes are 15.5 mm(0.61 inch) apart.&lt;br /&gt;
&lt;br /&gt;
'''NOTE'''&lt;br /&gt;
&lt;br /&gt;
'''Do not screw too far into the mounting holes as the screws can hit the gears. CQRobot Manufacturer recommends screwing no further than 3mm (1/8 inch) into the screw hole.'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Specification==&lt;br /&gt;
&lt;br /&gt;
* Encoder Operating Voltage: 3.3V - 24V&lt;br /&gt;
* Encoder Type: Hall (Incremental Type)&lt;br /&gt;
* Encoder Resolution: 64CPR&lt;br /&gt;
&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor7.jpg |left|500px]]&lt;br /&gt;
|[[File:Motor12.jpg |none|500px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Display==&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor2.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor3.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor4.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor4.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor10.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor6.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{|-&lt;br /&gt;
|[[File:Motor5.jpg |left|300px]]&lt;br /&gt;
|[[File:Motor8.jpg |none|300px]]&lt;br /&gt;
|[[File:Motor9.jpg |none|300px]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==DISTRIBUTION LIST==&lt;br /&gt;
&lt;br /&gt;
*1 * 6V/12V Metal DC Geared Motor w/Encoder&lt;/div&gt;</summary>
		<author><name>Yangguo</name></author>	</entry>

	</feed>