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 65 Serial.print(F(
" PortShieldL293d MoveRightDir() "));
68 Serial.print(F(
"for "));
69 Serial.print(inDuration);
70 Serial.println(F(
"ms"));
75 this->
pmotor->run(BACKWARD);
79 this->
pmotor->run(RELEASE);
82 this->
state = PORT_RIGHT;
87 this->
pmotor->run(RELEASE);
88 this->
state = PORT_STOP;
92 #ifdef ACCESSORIES_PRINT_ACCESSORIES 93 void PortShieldL293d::printPort()
95 Serial.print(F(
"[PortShieldL293d port: M"));
96 Serial.print((
int)this->printedOutPort, DEC);
97 Serial.print(F(
" speed:"));
98 Serial.print((
int)this->printedSpeed, DEC);
void MoveLeftDir(unsigned long inDuration = 0)
void MoveRightDir(unsigned long inDuration = 0)
virtual int SetSpeed(int inSpeed)
int SetSpeed(uint8_t inSpeed)