#include //basic include file void forward(int ontime, int offtime); // void reverse(int ontime, int offtime); // Motor speed is dependent on the ratio of ontime and offtime. void left(int ontime, int offtime); // ontime > offtime = greater speed void rotateL(int ontime, int offtime); // ontime < offtime = lesser speed void right(int ontime, int offtime); // void rotateR(int ontime, int offtime); // //Place Global Variables here int d; //use by sub-routines void main() { // initialization PBDD=0x00; // Always set Port B as output when using the motor controller // Define port direction depending on your needs while(1) //Program always in a loop { //Program starts here } } /* PB truth table: hex values: 0000 = stop 0x00 0010 = left 0x02 1111 = reverse 0x0f 1110 = rotateL 0x0e 1000 = right 0x08 1011 = rotateR 0x0b 1010 = forward 0x0a */ void forward(int ontime, int offtime) { PBOUT=0x0a; // forward for(d=0;d