Keyestudio 4WD Bluetooth Multi-functional Car Manual page 123

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

Advertisement

Sample Code:
******************************************************************************
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
unsigned char Bluetooth_val;
LiquidCrystal_I2C lcd(0x27,16,2); //defining liquid crystal
#define Lpwm_pin 5
//adjusting speed
#define Rpwm_pin 10
//adjusting speed //
int pinLB=2;
// defining pin2 left rear
int pinLF=4;
// defining pin4 left front
int pinRB=7;
// defining pin7 right rear
int pinRF=8;
// defining pin8 right front
unsigned char Lpwm_val = 255;
unsigned char Rpwm_val = 255;
int Car_state=0;
void M_Control_IO_config(void)
{
pinMode(pinLB,OUTPUT); // pin 2
pinMode(pinLF,OUTPUT); // pin 4
pinMode(pinRB,OUTPUT); // pin 7
pinMode(pinRF,OUTPUT); // pin 8
pinMode(Lpwm_pin,OUTPUT); // pin 11 (PWM)
pinMode(Rpwm_pin,OUTPUT); // pin 10 (PWM)
}
void Set_Speed(unsigned char Left,unsigned char Right)
keyestudio
//including the libraries of I2C-LCD1602 liquid crystal
//including the libraries of I2C
//defining variable val
www.keyestudio.com
121

Advertisement

Table of Contents
loading

Related Products for Keyestudio 4WD Bluetooth Multi-functional Car

Table of Contents