The rotation direction routine is written around Line 221 in the MAIN.C main function as shown in
"Figure 4-17 Rotation direction control".
When SW5 is set to the right side, the motor rotates to the right, and when it is set to the left side, the
motor rotates to the left.
void main(void)
{
(omitted)
/* main loop */
while (1)
{
if (!gCanEnableFlag)
{
(omitted)
/* Motor Rev Direction */
gMtRevDir = PDR2_P27;
/* Set Value */
gDirection = gMtRevDir;
(omitted)
}
(omitted)
}
}
←Acquisition of the rotation direction
←Configuration of the rotation direction
Figure 4-17 Rotation direction control
- 81 -
AN07-00180-3E