Keywish Hummer-Bot-2.0 Instruction Manual page 54

Table of Contents

Advertisement

3.2.2.6Software Design
In the above steps, we have tested the car's driving and obstacle avoidance module respectively, they
have achieved the desired results, here the "infrared obstacle avoidance" actually has been explained in this
section, but we have not put the programs of two parts together, so we now integrate the program of the two
parts and complete this great "infrared obstacle avoidance" project. Firstly, let's read the complete program:
#define INPUT1_PIN 6
#define INPUT2_PIN 10
#define INPUT4_PIN 9
#define INPUT3_PIN 5
const int
leftPin
const int
rightPin
float
dl;
float
dr;
void
setup()
{
Serial.begin(9600);
pinMode(leftPin, INPUT);
pinMode(rightPin, INPUT);
delay(1000);
}
Figure .3.2.15 Diagram of Data without Obstacles
// PWMB
// DIRB --- right
// PWMA
// DIRA --- left
= A3;
= A4;
51

Advertisement

Table of Contents
loading

Related Products for Keywish Hummer-Bot-2.0

Table of Contents