DFRobot DFR0004 Manual page 11

Dfrduino romeo-all in one controller
Hide thumbs Also See for DFR0004:
Table of Contents

Advertisement

2018/11/27
https://www.dfrobot.com/wiki/index.php/DFRduino_Romeo-All_in_one_Controller_V1.1(SKU:DFR0004)
DFRduino Romeo-All in one Controller V1.1(SKU:DFR0004) - DFRobot Electronic Product Wiki and Tutorial: Arduino and Robot Wiki-DFRobot.com
/ / S t a n d a r d P W M D C c o n t r o l
int E1 = 5;
/ / M 1 S p e e d C o n t r o l
int E2 = 6;
/ / M 2 S p e e d C o n t r o l
int M1 = 4;
/ / M 1 D i r e c t i o n C o n t r o l
int M2 = 7;
/ / M 1 D i r e c t i o n C o n t r o l
/ / / F o r p r e v i o u s R o m e o , p l e a s e u s e t h e s e p i n s .
/ / i n t E 1 = 6 ;
/ / M 1 S p e e d C o n t r o l
/ / i n t E 2 = 9 ;
/ / M 2 S p e e d C o n t r o l
/ / i n t M 1 = 7 ; / / M 1 D i r e c t i o n C o n t r o l
/ / i n t M 2 = 8 ; / / M 1 D i r e c t i o n C o n t r o l
void stop(void)
{
digitalWrite(E1,LOW);
digitalWrite(E2,LOW);
}
void advance(char a,char b)
{
analogWrite (E1,a);
/ / P W M S p e e d C o n t r o l
digitalWrite(M1,HIGH);
analogWrite (E2,b);
digitalWrite(M2,HIGH);
}
void back_off (char a,char b)
{
analogWrite (E1,a);
digitalWrite(M1,LOW);
analogWrite (E2,b);
digitalWrite(M2,LOW);
}
void turn_L (char a,char b)
{
analogWrite (E1,a);
digitalWrite(M1,LOW);
analogWrite (E2,b);
digitalWrite(M2,HIGH);
}
/ / S t o p
/ / M o v e f o r w a r d
/ / M o v e b a c k w a r d
/ / T u r n L e f t
11/16

Advertisement

Table of Contents
loading

Table of Contents