MCP4261 Mcp4261_U2 = MCP4261( CSU2Pin, rAB_ohms ); MCP4261 Mcp4261_U3 = MCP4261( CSU3Pin, rAB_ohms ); MCP4261 Mcp4261_U4 = MCP4261( CSU4Pin, rAB_ohms ); MCP4261 Mcp4261_U5 = MCP4261( CSU5Pin, rAB_ohms ); int pwm_1; int pwm_2; int pwm_3; int pwm_4; int pwm_5; int pwm_6; int pwm_7; int pwm_8; //declare instances of the CAN class MCP_CAN CAN4 = MCP_CAN(53); // void setPinModes() { //Initialize the SPI chip pins pinMode(CSU1Pin, OUTPUT); pinMode(CSU2Pin, OUTPUT); pinMode(CSU3Pin, OUTPUT); pinMode(CSU4Pin, OUTPUT); pinMode(CSU5Pin, OUTPUT); digitalWrite(CSU1Pin,HIGH); digitalWrite(CSU2Pin,HIGH); digitalWrite(CSU3Pin,HIGH); digitalWrite(CSU4Pin,HIGH);
Can_Controller::Can_Controller () : begun(false) { delegate = MCP_CAN(MCP_CS_PIN); }
*/ #include "Arduino.h" #include "mcp_can.h" #include "SPI.h" #include "Mcp4261.h" #include "SSSdaughter6.h" #include "Wire.h" MCP4261 Mcp4261_U1 = MCP4261( CSU1Pin, 10000 ); MCP4261 Mcp4261_U2 = MCP4261( CSU2Pin, 10000 ); MCP4261 Mcp4261_U3 = MCP4261( CSU3Pin, 10000 ); MCP4261 Mcp4261_U4 = MCP4261( CSU4Pin, 10000 ); MCP4261 Mcp4261_U5 = MCP4261( CSU5Pin, 10000 ); //declare instances of the CAN class MCP_CAN CAN4 = MCP_CAN(3); // MCP_CAN CAN5 = MCP_CAN(77); // void setPinModes() { //Initialize pin modes pinMode(CSCAN4Pin, OUTPUT); pinMode(CSCAN5Pin, OUTPUT); pinMode(CSU1Pin, OUTPUT); pinMode(CSU2Pin, OUTPUT); pinMode(CSU3Pin, OUTPUT); pinMode(CSU4Pin, OUTPUT); pinMode(CSU5Pin, OUTPUT); pinMode(CSU6Pin, OUTPUT);