I am writing some code where I am trying to create a DriveTrain class. This DriveTrain class will contain two private members: controllerFront and controllerRear, both of which will be instances of the RoboClaw class. The problem is that in order for the RoboClaw classes to do their thing, and for the DriveTrain class to initialize serial, it needs to invoke:
Problem is Serial1 is not in scope inside DriveTrain.cpp. So, I want to pass the Serial1 instance on the DriveTrain’s constructor… but I can’t find the exact data type, nor can I find the header file in which the data type is defined. I have been through the Wiring programming reference and the Spark guides, but there’s very little that tells me where all the ‘injected magic’ in the .ino file (like Serial, Serial1, etc) comes from.
Can someone help guide a n00b to properly encapsulating the serial controller logic I need to write?