EasyManua.ls Logo

Keyestudio 4WD Bluetooth Multi-functional Car - Page 123

Keyestudio 4WD Bluetooth Multi-functional Car
151 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
keyestudio
www.keyestudio.com
121
Sample Code
******************************************************************************
#include <LiquidCrystal_I2C.h> //including the libraries of I2C-LCD1602 liquid crystal
#include <Wire.h> //including the libraries of I2C
unsigned char Bluetooth_val; //defining variable 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)

Related product manuals