Keyestudio 4WD Bluetooth Multi-functional Car Manual page 134

Hide thumbs Also See for 4WD Bluetooth Multi-functional Car:
Table of Contents

Advertisement

unsigned char SM;
//state of middle sensor of line tracking module
unsigned char SR;
//state of right sensor of line tracking module
int inputPin=A0; // ultrasonic module
int outputPin=A1; // ultrasonic module TRIG to A1
unsigned char Bluetooth_val;
LiquidCrystal_I2C lcd(0x27,16,2);
#define Lpwm_pin 5
//pin of controlling speed---- ENA of motor driver board
#define Rpwm_pin 10
//pin of controlling speed---- ENB of motor driver board
int pinLB=2;
//pin of controlling turning---- IN1 of motor driver board
int pinLF=4;
//pin of controlling turning---- IN2 of motor driver board
int pinRB=7;
//pin of controlling turning---- IN3 of motor driver board
int pinRF=8;
//pin of controlling turning---- IN4 of motor driver board
unsigned char Lpwm_val = 250; //initialized left wheel speed at 250
unsigned char Rpwm_val = 250; //initialized right wheel speed at 250
int Car_state=0;
//the working state of car
int servopin=3;
//defining digital port pin 3, connecting to signal line of servo motor
int myangle;
//defining variable of angle
int pulsewidth;
//defining variable of pulse width
unsigned char DuoJiao=60;
//initialized angle of motor at 60°
void Sensor_IO_Config()
//IO initialized function of three line tracking , all setting at input
{
pinMode(SensorLeft,INPUT);
pinMode(SensorMiddle,INPUT);
pinMode(SensorRight,INPUT);
}
void Sensor_Scan(void) //function of reading-in signal of line tracking module
keyestudio
ECHO to A0
// ultrasonic module TRIG to A1
//defining liquid crystal
www.keyestudio.com
132

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 4WD Bluetooth Multi-functional Car and is the answer not in the manual?

Related Products for Keyestudio 4WD Bluetooth Multi-functional Car

Table of Contents

Save PDF