Вы находитесь на странице: 1из 30

http://keyes-arduino.taobao.

com

Smart car manual


ultrasonic obstacle
avoidance

I. Brief introduction
ARDUINO ultrasonic intelligent obstacle avoidance car is a single-chip learning
applicati on development system to arduino atmega-328 series microcontroller
core. Complete ultrasonic obstacle avoidance functi on. Kit contains a number of
interesti ng programs, and expand external circuit module, thereby increasing the
car's functi onality. designed to allow users in learning from the microcontroller
ARDUINO boring theoreti cal knowledge, ability to obtain single-chip system
developed in the play.

II. Parameters:
1. Motor parameters: voltage range: 1.5-12V, motor shaft length: 10mm, speed 6.0V
100rpm / min.
2. Control motor selection L298N driver module, and MCU real isolation.
3. Avoidance part of HC-SR04 ultrasonic, stable performance, measure the distance
accurately.
6. To access the external voltage 7 ~ 12V. And can be equipped with a variety of sensor
module, to implement various functions, depending on your imagination.

III. Experimental Courses


http://keyes-arduino.taobao.com
1. L298N motor driver board applications
2. Ultrasonic modules
3. Ultrasonic obstacle avoidance smart car
IV. Listing
Listing:
1. geared motor 2
2. The quality of the tire 2
3. The motor holder 2
4. Wheels 1
5.100 * 150 * 2.6MM plexiglass plate 2
6.L298N motor drive board a
7.ARDUINO 328 to force the board 1
8. PTZ 1
9. servos 1
The ultrasonic module 1
11. mini bread board a
12.6 on the 5th battery box a
13. DuPont line 12
14.1 m long USB cable 1
15. The pillars 35MM length 3 12MM 4 个
Some 16.3MM screw nut

V. ultrasonic obstacle avoidance car head


Installation Instructions
http://keyes-arduino.taobao.com
http://keyes-arduino.taobao.com

Installation is complete! THX!


VI. Arduino MCU use
1 . Int roduc tion

Arduino is derived from the Italian an open source hardware project platform
comprises a with a simple I / O capabilities of the circuit board and a
development environment software. Arduino can be used to develop
interactive products, such as it can read a large number of switches and
sensors signal, and can control lights, motors and other kinds of physical
equipment; Arduino also can develop peripheral devices connected to the PC,
can and software on the PC to communicate with the runtime. Arduino
hardware circuit board can assemble their own welding, can also be
purchased already assembled modules, and application development
environment software you can download and use for free from the Internet.
We look at how the team defined for Arduino:

Defined Arduino is still a little fuzzy, which is the Arduino advantage. Arduino is that people
connect various tasks adhesives. Arduino next to give the most accurate definition of best use
to describe some examples. You want coffee brewed, the coffee pot on the issue "creak"
sound to remind you? If you want to mailbox has a new message, the phone will alert notice
you?
Want a glittering pile toy? Want a Professor X Steampunk style with wheelchairs voice and
drinks distribution function of it? Press the shortcut key you want to set the experiment can
be performed to test the buzzer it? Think of your son made a "Metroid" cannon arm it?
Homemade want a heart rate monitor, the cyclist's record every deposit into the memory
card? A thought can be made on the ground drawing robot can ride in the snow it?

Arduino think that you can achieve. For understand electronics or


microcontroller people, this sounds cool, very interesting, and will want to join
this club. This is something kids want to make, you can even fool some of their
high school knowledge in the process. These projects generate in science fiction
stories, these little devices appear in the log. Its common is that these are
illusions, are some of the stuff of dreams. But now, these wonderful ideas really
been implemented in a timely manner you are not an engineer, but also can be
made.

This is a great event, because engineers often design engineers to develop for
other platforms, instead of artists, freak, or young children in order to share an
idea and simply things connected. Arduino team than by the "hard core" of
electronic engineers, but by designers, teachers, artists, and I know all the
"technical hippies" component (hippies here is a compliment, I hope I did not
offend them). Arduino main base in Italy, every year I see the article about the
Italian people trying to find "their own Google", while in fact they already have,
and that is Arduino, they do not realize it.

Look at examples of Arduino projects, you will find for these electronic
products makers are "what is" more interested in, rather than production
methods. These enthusiasts often expressed Arduino Arduino does not teach
basic electronics, "Bah, This is what is truly electronic products ah," they say,
"Too easy!" Yes, indeed. If you are an artist or designer, without using Arduino
case, want LED flashes, or motor rotation, then I wish you good luck. Of
course, if you are willing to spend money and take your electronic product
technology heavy textbooks to show some, this is not a bad idea. But there are
other people, they just want to decorate with light-emitting diode Burning Man
clothing only.

For some traditional microcontroller Arduino community is how to treat the


problem, I think the best example is the AVR Freaks, the official website
focuses on AVR processor (also used for Arduino). You'll want to AVR Freaks
community might like Arduino, because Arduino AVR microcontroller can be
brought to the public. However, many people do not like all of the site's weird
contraption made of these non-engineers, because they will destroy their
hierarchy. My favorite quote from (I hope these words printed on a T-shirt).
"Arduino programming language that children can understand, once addicted"
- ArnoldB, AVRfreaks website in fact, this erroneous attitude has driven
Arduino fans to build their own community, he helped establish a Arduino
eclectic, rather than high above community.

Arduino is simple, but not too simple. It is around these ideas to create that
students use Arduino to achieve the purpose of: receiving sensor signals, get
some code, and then use these signals and codes. Perhaps not even write code,
you can start after that they cut paste code. Arduino is a thermal adhesive,
rather than precise welding. So no one will be cut off one hand, there will be
laboratories were destroyed. One of Arduino team members will teach arts and
crafts people and designers how to use. Every day, Arduino establishment and
improvement in learning, professors, and shared code project. The arts and
crafts people and designers to use and modify on the Processing language
systems are Macs. (Processing is the eldest brother Arduino)

Speaking here, Arduino is like a passion, no boundaries, artistic atmosphere of


the rally. This is the Arduino a "DIY" success story reason? Not only that, we
come to understand more details. Library - simple tasks, complex tasks easy to
get a lot of package library is used to perform complex tasks, such as write to
the SD memory card, write the LCD driver,
Analytical GPS. There are also some libraries used to do simple things, such as
rotating pin or key debounce. If there are 10 chips, we have installed the UART
code written 10 times, and frankly, this annoying. If you call Serial.begin
(9600) function to handle the register data, then it is much easier.

Lightweight run directly use a certified on the underlying hardware, easy to


understand compiler (we can even say that is the AVR avr-gcc compiler default
or standard), the code can be run directly on the underlying hardware. Compile
manner NET BASIC language and different languages. The compiler runs fast,
small size, light weight, and you can use HEX (hexadecimal) file for the bulk of
the new chip is programmed.

Sensor
Arduino really take off because it enables analog input is converted to a digital
input, in other words, you can light, temperature, sound, or already on the
market any low-cost sensor signal input, Arduino can be identified. For digital
sensors, Arduino supports SPI (high-speed synchronous serial port) and the
I2C bus. This feature covering 99% of the sensor on the market. Other
development platform is not easy to achieve - think if a Beagleboard (great
product) and Arduino tied together, just to get the data of the sensor, it was so
strange!
Simple but not too simple, traditional development board is often too
complicated, there are a lot of accessories, such as LCD, buttons, LEDs, 7-
segment digital tube and so on. Development Board showed its all functions.
Number Function Arduino board shows the absolute minimum, if you want to
expand the functions, just add Shield (shield). Arduino Shield There are
hundreds, from LCD to wireless Internet access technology, but to increase
the number Shield set by the user. Extended Shield features are also easy to
make people extend Shield functionality will stimulate commercial.
Non-Chip Manufacturer

Arduino development board is not designed by the chip manufacturer. Why


emphasize this point? Because the chip maker in order to highlight their
products unique, they often add some strange things. The Arduino emphasize
commonalities rather than differences between the microcontroller. This
means that the Arduino is an excellent platform for beginners, as long as the
Arduino board can do, you can do on any other microcontroller. This basic
features will be with you a long time.

2. Arduino-driven programming and program installation


First, download the Arduino development software, web address: http:
//arduino.cc/en/Main/Software
Downloaded file is a compressed folder arduino-0023.zip, unzip it to your
hard drive.
When connected to the Arduino board to force Windows via USB cable, it will
prompt new USB device named "FT232R USB UART" found, then Windows
will guide us into the "Found New Hardware Wizard" window, select one of
the "No, no "option, click" Next "button:
The next step you need to install the required drivers Arduino, select one of
the "Install from a list of specific location (Advanced)" option, click "Next"
button:

Arduino USB drive on drivers directory Arduino 0021 installation directory,


we need to Windows
The directory specified when installing the driver search directory:

Click the "Next" button, Windows will begin to find and install the Arduino
USB drivers:
If everything goes well, we will see the following interface successfully:

After the Arduino USB driver installation is successful, we can find the serial Arduino in
the Windows Device Manager:
Here the first demonstration of a program programmer, illuminated "L" lights
In Arduino-0023 programming interface, click [Tools], move the mouse to the
[Board] drop-down menu option in the pop-up submenus continuing seen,
[arduino Duemilanove] if there is a black dot in front of, if not, the point click
[arduino Duemilanove] this option.

Down to choose the right COM connection. Remember when just installed hardware
requirements that you record
(COMX) What value of X? We should use here. Arduino just installed as the port is 21,
so the mouse
21 on tap.
Let come to import a "L" light flashes sample program, the left mouse button [File] pull-down
menu in which you move the mouse to the [Examples], menu extensions to the right to move the
mouse to [1.Basics] [1.Basics ] after that, the menu continues to expand, find [Blink], left-click on
[Blink]
Direct point icon left red arrow 1 referred to, you will find, on the Arduino
board will have two yellow light will flash for a while with two mad flash of
yellow light goes out. Programming box appears below the text prompts, L
lamp on the motherboard with one second blinking once.
Then congratulations to you, your first program has been successful! ! !

VII. Experimental details


1. L298N motor driver board applications
L298N bridge driver board. Please refer to (L298N dual H-bridge DC motor driver board
manual), here is not to say, but there are some users do not know how to control two DC motors,
here to do some detail.
First VMS drive section can be accessed by an external power supply to take power, usually
around 9V more appropriate, logical part board can take power within that floating terminals can
also be access + 5V- + 7V. Two rows of three pins around the terminal were used to control two
DC motors. EA, EB access ArduinoPWM interfaces for motor speed, I1, I2, I3, I4 interfaces are
used to control two DC motors forward, backward, steering and brakes, simply access Arduino
digital interface. This preparatory work basically completed, you can write a program, and here I
put the car straight, backward, turn left, turn right, brake functions are written into the program
for your reference.
Procedures are as follows:
int pinI1 = 8; // define interfaces I1 int pinI2 = 9; // define I2 Interface
int speedpin = 11; // define EA (PWM Speed) interface int pinI3 = 6; // define the I3 Interface
int pinI4 = 7; // define I4 Interface
int speedpin1 = 10; // define EB (PWM Speed) interface void setup ()
{
pinMode (pinI1, OUTPUT); pinMode (pinI2, OUTPUT); pinMode (speedpin, OUTPUT);
pinMode (pinI3, OUTPUT); pinMode (pinI4, OUTPUT); pinMode (speedpin1, OUTPUT);
}
void loop ()
{
// Straight
analogWrite (speedpin, 100); // input analog values set speed analogWrite (speedpin1,100);
digitalWrite (pinI4, LOW); // make DC motor (right) turn counterclockwise digitalWrite (pinI3,
HIGH); digitalWrite ( pinI1, LOW); // make DC motor (left) clockwise digitalWrite (pinI2,
HIGH);
delay (2000);
// Back
analogWrite (speedpin, 100); // input analog values set speed analogWrite (speedpin1,100);
digitalWrite (pinI4, HIGH); // make DC motor (right) clockwise digitalWrite (pinI3, LOW);
digitalWrite (pinI1, HIGH); // make DC motor (left) turn counterclockwise digitalWrite (pinI2,
LOW);
delay (2000);
//Turn left
analogWrite (speedpin, 60); // input analog values set speed analogWrite (speedpin1,60);
digitalWrite (pinI4, LOW); // make DC motor (right) turn counterclockwise digitalWrite (pinI3,
HIGH); digitalWrite ( pinI1, HIGH); // make DC motor (left) turn counterclockwise digitalWrite
(pinI2, LOW);
delay (2000);
//Turn right
analogWrite (speedpin, 60); // input analog values set speed analogWrite (speedpin1,60);
digitalWrite (pinI4, HIGH); // make DC motor (right) clockwise digitalWrite (pinI3, LOW);
digitalWrite ( pinI1, LOW); // make DC motor (left) clockwise digitalWrite (pinI2, HIGH);
delay (2000);
// Brakes
digitalWrite (pinI4, HIGH); // make DC motor (right) Brake digitalWrite (pinI3, HIGH);
digitalWrite (pinI1, HIGH); // make DC motor (left) brake digitalWrite (pinI2, HIGH);
delay (2000);
}
Note: The program I used the left and turn right just turning in a controlled manner, otherwise not
list them, you can try it yourself.

2. Ultrasonic Ranging Module


First, the application of ultrasonic point due to the strong prospects, the energy
consumption is slow, propagating in the medium distance, thus ultrasound is often
used to measure distances, such as range finders and level measurement and so

can be achieved by ultrasound. Use of ultrasonic testing is often more rapid,


convenient, simple calculation, easy to do real-time control, and the measurement
accuracy can be achieved in the practical requirements of industrial, so the
development of the mobile robot has also been widely used.
Second, product introduction
HY -SRF05 ultrasonic ranging module can provide 2cm-450cm non-contact sensing
distances ranging accuracy can be up to 3mm, can well meet our normal
requirements. The module includes an ultrasonic transmitter, receiver and
corresponding http://keyes-arduino.taobao.com
The control circuit. Third, the principle to look at the timing of its work:

1, we first pulled TRIG, then at least 10us high signal to go trigger;


2, after the trigger, the module will automatically transmit eight 40KHZ
square wave and automatically detect whether a signal return.
3, if a signal is returned, through ECHO outputs a high level, high duration is
Ultrasonic time from launch to receive. Then the test distance = high
Duration * 340m / s * 0.5; IV. Electrical parameters
Working voltage: 0.5V (DC) Operating Current: 15mA
Detection range: 2-450cm detection angle: 15 degrees
Input trigger pulse: 10us TTL level
Output echo signal: TTL level output signal (high), with a range of
proportional http://keyes-arduino.taobao.com
V. Instructions

Module description of each pin shown above, use as long as two-port


control Trig and Echo on the line in the Arduino, concrete will they
receive both digital ports, on how to control, the following
description will be routine, then connect the power and land on the
line. . . . .
Sixth, the module test Arduino controller × 1 USB cable × 1 × 1
ultrasonic module
http://keyes-arduino.taobao.com
Ah, just so many, let's look at connections]
Above D4, D5 refers to 4,5-pin digital port, the following are the specific
physical connection for reference Well, this time we have to do is learn how
to use it to measure the distance, and in the computer is displayed on the
screen, of course, if you do look better, you can add a digital lcd or the like,
we are here is to be a functional test is a heuristic process.
Ah, here are our test code.
http://keyes-arduino.taobao.com
int inputPin=4; // define ultrasonic signal receiver pin ECHO to D4
int outputPin=5; // define ultrasonic signal transmitter pin TRIG to D5
void setup()
{
Serial.begin(9600);
pinMode(inputPin, INPUT);
pinMode(outputPin, OUTPUT);
}
void loop()
{
digitalWrite(outputPin, LOW);
delayMicroseconds(2);
digitalWrite(outputPin, HIGH); // Pulse for 10μ s to trigger ultrasonic
detection
delayMicroseconds(10);
digitalWrite(outputPin, LOW);
int distance = pulseIn(inputPin, HIGH); // Read receiver pulse time
distance= distance/58; // Transform pulse time to distance
Serial.println(distance); //Ourput distance
http://keyes-arduino.taobao.com
delay(50);
}
Of course, the above test code compile, download it to our Arduino dashboard, and open the
Serial Monito window, will be able to see a series of data, that is what we want, the same as the
following. . . . .
Well, the test results have, can be used normally. . .

3. The ultrasonic obstacle avoidance


smart car
Ultrasonic intelligent obstacle avoidance for easy, simple calculation, easy to
do real-time control, and the measurement accuracy can be achieved in a
practical requirement, and therefore become a common obstacle avoidance
methods. Ultrasound use reference (Arduino Ultrasonic Ranging
instructions). Ultrasonic intelligent wiring diagram;

1: Motor connection
A motor connected to the MOTOA L298N L298N motor connected two of
MOTOB
2: L298N supply process
With 6 on the 5th battery box to take all the way to the L298N motor drive
module power supply, another way to ARDUINO board power supply, to
L298N motor drive module power supply + pole connected L298N of VMS
interface, power - the connection of GND L298N interfaces, L298N board +
5V interfaces vent is not connected.
3: Enable and steering motors (with the program)
int pinLB = 6; // Definition 6 pin rear left, then to the force plate PWM6 foot
int pinLF = 9; // define the 9 pin front left, then to the force plate PWM9 foot
int pinRB = 10; // define the right after 10 pin , then to force the board
PWM10 foot int pinRF = 11; // define the 11 pin front, then to the foot force
plate PWM11

Four: Servo connection

myservo.attach (5); // define the servo motor output 5 pin (PWM)

Five: Ultrasonic sensors


Ultrasonic sensors have
four wires connected to +
5V pin VCC
ECHO TRIQ signal input
signal output GND
Ground

int inputPin = A0; // define the ultrasonic signal receiving pin


int outputPin = A1; // define the ultrasonic signal transmitting pin
Ultrasonic intelligent car obstacle avoidance procedures (ARDUINO)
L = Left R = Right F = B = before after
*/
#include <Servo.h>
int pinLB = 6; // Definition 6 pin rear left
int pinLF = 9; // define Pin Left Front 9

int pinRB = 10; // define the 10-pin right rear int pinRF = 11; // define the 11-
pin front right

int inputPin = A0; // define the ultrasonic signal receiving pin


int outputPin = A1; // define the ultrasonic signal transmitting pin

int Fspeedd = 0; // speed before int Rspeedd = 0; // Right-speed int Lspeedd


= 0; // Left speed
int directionn = 0; // = before after 8 = 2 Left = 4 Right = 6 Servo
myservo; // set myservo
int delay_time = 250; // stabilization time after steering servo motor

int Fgo = 8; // Forward


int Rgo = 6; // turn right
int Lgo = 4; // turn left
int Bgo = 2; // reverse

void setup ()
{
Serial.begin (9600); // define the motor output pin pinMode (pinLB,
OUTPUT); // pin 8 (PWM) pinMode (pinLF, OUTPUT); // pin 9 (PWM) pinMode
(pinRB, OUTPUT) ; // pin 10 (PWM) pinMode (pinRF, OUTPUT); // pin 11
(PWM)

pinMode (inputPin, INPUT); // define the ultrasonic input pin


pinMode (outputPin, OUTPUT); // define the ultrasonic output pins

myservo.attach (5); // define the servo motor output 5 pin (PWM)


}
void advance (int a) // Forward
{
digitalWrite (pinRB, LOW); // the motor (right rear) action digitalWrite
(pinRF, HIGH); digitalWrite (pinLB, LOW); // the motor (rear left) action
digitalWrite (pinLF, HIGH);
delay (a * 100);
}

void right (int b) // Turn right (single wheel)


{
digitalWrite (pinRB, LOW); // the motor (right rear) action digitalWrite
(pinRF, HIGH); digitalWrite (pinLB, HIGH); digitalWrite (pinLF, HIGH);
delay (b * 100);
}
void left (int c) // turn left (single wheel)
{
digitalWrite (pinRB, HIGH); digitalWrite (pinRF, HIGH); digitalWrite (pinLB,
LOW); // the motor (rear left) Action
digitalWrite (pinLF, HIGH); delay (c * 100);
}
void turnR (int d) // Turn right (wheel)
{
digitalWrite (pinRB, LOW); // the motor (right rear) action digitalWrite
(pinRF, HIGH); digitalWrite (pinLB, HIGH);
digitalWrite (pinLF, LOW); // the motor (front left) Action
delay (d * 100);
}
void turnL (int e) // turn left (wheel)
{
digitalWrite (pinRB, HIGH); digitalWrite (pinRF, LOW); // the motor (front
right) action digitalWrite (pinLB, LOW); // the motor (rear left) action
digitalWrite (pinLF, HIGH);
delay (e * 100);
}
void stopp (int f) // stop
{
digitalWrite (pinRB, HIGH); digitalWrite (pinRF, HIGH);
digitalWrite (pinLB, HIGH); digitalWrite (pinLF, HIGH); delay (f * 100);
}
void back (int g) // Back
{

digitalWrite (pinRB, HIGH); // the motor (right rear) action digitalWrite


(pinRF, LOW); digitalWrite (pinLB, HIGH); // the motor (rear left) action
digitalWrite (pinLF, LOW);
delay (g * 100);
}

void detection () // measuring three angles (0.90.179)


{
int delay_time = 250; // stabilization time after steering servo motor
ask_pin_F (); // read in front of the distance

if (Fspeedd <10) // if the distance is less than 10 cm in front of


{
stopp (1); // clear the output data
back (2); // back 0.2 seconds
}

if (Fspeedd <25) // if the distance is less than 25 cm in front of


{
stopp (1); // clear the output data
ask_pin_L (); // read the left from the delay (delay_time); // wait for the servo
motor stable ask_pin_R (); // read the right distance delay (delay_time); //
wait for the servo motor stable

if (Lspeedd> Rspeedd) // if the distance is greater than the right side from
the left
{
directionn = Rgo; // go right
}

if (Lspeedd <= Rspeedd) // if the distance is less than or equal to the right of
the left distance
{
directionn = Lgo; // Turn Left
}

if (Lspeedd <10 && Rspeedd <10) // if the distance between the left and
right are less than 10 cm distance
{
directionn = Bgo; // go back
}
}
else // add as front no less than (greater than) 25 cm
{
directionn = Fgo; // move forward
}

}
void ask_pin_F () // Measure the distance from the front
{
myservo.write (90);
digitalWrite (outputPin, LOW); // Let ultrasonic transmitter low voltage 2μs
delayMicroseconds (2);
digitalWrite (outputPin, HIGH); // make ultrasonic transmitting high voltage
10μs, here at least is 10μs
delayMicroseconds (10);
digitalWrite (outputPin, LOW); // maintaining the low-voltage ultrasonic
transmitter
float Fdistance = pulseIn (inputPin, HIGH); // read time difference difference
Fdistance = Fdistance / 5.8 / 10; // the time into distance (unit: cm)
Serial.print ("F distance:"); // output distance (unit: cm) Serial.println
(Fdistance); // Display distance
Fspeedd = Fdistance; // will enter Fspeedd (former speed) distance reading
}
void ask_pin_L () // Measure the distance left
{
myservo.write (5); delay (delay_time);
digitalWrite (outputPin, LOW); // Let ultrasonic transmitter low voltage 2μs
delayMicroseconds (2);
digitalWrite (outputPin, HIGH); // make ultrasonic transmitting high voltage
10μs, here at least is 10μs delayMicroseconds (10);
digitalWrite (outputPin, LOW); // maintaining the low-voltage ultrasonic
transmitter
float Ldistance = pulseIn (inputPin, HIGH); // read time difference difference
Ldistance = Ldistance / 5.8 / 10; // the time into distance (unit: cm)
Serial.print ("L distance:"); // output distance (unit: cm) Serial.println
(Ldistance); // Display distance
Lspeedd = Ldistance; // will be read into the distance Lspeedd (left velocity)
}
void ask_pin_R () // Measure the distance to the right
{
myservo.write (177); delay (delay_time);
digitalWrite (outputPin, LOW); // Let ultrasonic transmitter low voltage 2μs
delayMicroseconds (2);
digitalWrite (outputPin, HIGH); // make ultrasonic transmitting high voltage
10μs, here at least is 10μs delayMicroseconds (10);
digitalWrite (outputPin, LOW); // maintaining the low-voltage ultrasonic
transmitter
float Rdistance = pulseIn (inputPin, HIGH); // read time difference difference
Rdistance = Rdistance / 5.8 / 10; // the time into distance (unit: cm)
Serial.print ("R distance:"); // output distance (unit: cm) Serial.println
(Rdistance); // Display distance
Rspeedd = Rdistance; // will be read into the distance Rspeedd (the right
speed)
}

void loop ()
{
myservo.write (90); // make servo motor regression ready position ready for
the next measurement
detection (); // To measure the angle and determine where to move in one
direction

if (directionn == 2) // if directionn (direction) = 2 (reverse)


{
back (8); // reverse (car)
turnL (2); // move slightly to the left (to prevent stuck in dead alley)
Serial.print ("Reverse"); // display direction (reverse)
}
if (directionn == 6) // if directionn (direction) = 6 (right turn)
{
back (1);
turnR (6); // turn right
Serial.print ("Right"); // display direction (turn left)
}
if (directionn == 4) // if directionn (direction) = 4 (left)
{
back (1);
turnL (6); // turn left
Serial.print ("Left"); // display direction (turn right)
}
if (directionn == 8) // If directionn (direction) = 8 (forward)
{
advance (1); // normal forward Serial.print ("Advance"); // display direction
(forward) Serial.print ("");
}
}
Trademark Notice:

Robotale and graphics for the Branch-Interactive Technology Co., Ltd.


registered trademark. Based on the continuous improvement and upgrading
of products, the company is subject to change or referred to in this document
and the products which shall not notice. Without prior written consent or
authorization, any unauthorized misappropriation, copying, publishing partial
description of the product or the entire contents.

Disclaimer:

Users in the use of this product in any application made (such as


experiments, contests, secondary development), the user shall bear the risk
of the company for direct, indirect or collateral damage arising from the use
of this product (including the loss of personal security, profit credit losses,
etc.), no responsibility, children under 14 years old must only use the product
accompanied by an adult related experiments.
Errata Description:

In order to convey the correct use of the product information, we spend a lot
of time and energy on this manual, which want users to be able to read the
contents, but inevitably there are omissions. If mistakes are found, welcome
to contact us by e-mail jmddz925@126.com. In order to make the manual
more complete, provide the latest and most detailed information, we will
continue to improve the content of the manual supplement.