7 #if !defined(__AVR_ATmega32U4__) 11 #ifndef NO_SHIELDL293D 19 this->
pmotor =
new AF_DCMotor(inOutPort, inFreq);
20 this->
pmotor->pwmfreq = inFreq;
21 this->
pmotor->setSpeed(inSpeed);
23 #ifdef ACCESSORIES_PRINT_ACCESSORIES 24 this->printedOutPort = inOutPort;
25 this->printedSpeed = inSpeed;
28 this->
pmotor->run(RELEASE);
34 this->
pmotor->setSpeed(inSpeed);
40 #ifdef ACCESSORIES_DEBUG_MODE 41 Serial.print(F(
" PortShieldL293d MoveLeftDir() "));
44 Serial.print(F(
"for "));
45 Serial.print(inDuration);
46 Serial.println(F(
"ms"));
51 this->
pmotor->run(FORWARD);
55 this->
pmotor->run(RELEASE);
58 this->state = PORT_LEFT;
63 #ifdef ACCESSORIES_DEBUG_MODE 64 Serial.print(F(
" PortShieldL293d MoveRightDir() "));
67 Serial.print(F(
"for "));
68 Serial.print(inDuration);
69 Serial.println(F(
"ms"));
74 this->
pmotor->run(BACKWARD);
78 this->
pmotor->run(RELEASE);
81 this->state = PORT_RIGHT;
86 this->
pmotor->run(RELEASE);
87 this->state = PORT_STOP;
90 #ifdef ACCESSORIES_PRINT_ACCESSORIES 91 void PortShieldL293d::printPort()
93 Serial.print(F(
"[PortShieldL293d port: M"));
94 Serial.print((
int)this->printedOutPort, DEC);
95 Serial.print(F(
" speed:"));
96 Serial.print((
int)this->printedSpeed, DEC);
void MoveRightDir(unsigned long inDuration = 0)
void MoveLeftDir(unsigned long inDuration = 0)
virtual int SetSpeed(int inSpeed)
int SetSpeed(uint8_t inSpeed)