DFRobot DFR0004 Manuel - Page 14

Parcourez en ligne ou téléchargez le pdf Manuel pour {nom_de_la_catégorie} DFRobot DFR0004. DFRobot DFR0004 16 pages. Dfrduino romeo-all in one controller
Également pour DFRobot DFR0004 : Manuel (13 pages), Manuel (11 pages)

DFRobot DFR0004 Manuel
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 D L L S p e e d c o n t r o l
int E1 = 4;
/ / M 1 S p e e d C o n t r o l
int E2 = 7;
/ / M 2 S p e e d C o n t r o l
int M1 = 5;
/ / M 1 D i r e c t i o n C o n t r o l
int M2 = 6;
/ / 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
/ / W h e n m 1 p / m 2 p i s 1 2 7 , i t s t o p s t h e m o t o r
/ / w h e n m 1 p / m 2 p i s 2 5 5 , i t g i v e s t h e m a x i m u m s p e e d f o r o n e d i r e c t i o n
/ / W h e n m 1 p / m 2 p i s 0 , i t g i v e s t h e m a x i m u m s p e e d f o r r e v e r s e d i r e c t i o n
void DriveMotorP(byte m1p, byte m2p)
{
digitalWrite(E1, HIGH);
analogWrite(M1, (m1p));
digitalWrite(E2, HIGH);
analogWrite(M2, (m2p));
}
void setup(void)
{
int i;
( i=6;i<=9;i++)
f o r
pinMode(i, OUTPUT);
Serial.begin(19200);
/ / S e t B a u d R a t e
}
void loop(void)
{
( Serial.available()){
i f
char val = Serial.read();
/ / D r i v e M o t o r P o w e r M o d e
14/16