 	setupTimer(10000); //10ms / 10000us ticks / 100Hz
 	Serial.println("100hz update frequency");
 
-	//This will not be hard coded soon. It should be a list of every hardware support module
+        motorcontroller = new DMOC(&CAN); //instantiate a DMOC645 device controller as our motor controller
+        
+        //This will not be hard coded soon. It should be a list of every hardware support module
 	//compiled into the ROM
 	Serial.println("Installed devices: DMOC645");
 

            if (!runRamp) {
                throttleval = 0;
            }
            dmoc.setThrottle(throttleval * (int)12); //with throttle 0-80 this sets throttle to 0 - 960
	}
	else {
            dmoc.setThrottle(throttle.getThrottle());
//            Serial.println(throttle.getThrottle());  //just for debugging
		}
		dmoc.handleTick();
	}
}


/*Single single character interpreter of commands over
serial connection. There is a help menu (press H or h or ?)
*/
void serialEvent() {
	int incoming;
	incoming = Serial.read();
	if (incoming == -1) return;
	switch (incoming) {
	case 'h':

// Create CAN object with pins as defined
MCP2515 CAN(CS_PIN, RESET_PIN, INT_PIN);
POT_THROTTLE throttle(0, 1); //specify the ADC ports to use for throttle 255 = not used (valid only for second value)
MOTORCTRL* motorcontroller; //generic motor controller - instantiate some derived class to fill this out

void printMenu();

