|
|
@@ -64,8 +64,13 @@ const int Active_ControllerID_HEX = Active_ControllerID ;
|
|
|
|
|
|
|
|
|
|
|
|
+//#define CAN_CSpin 10
|
|
|
+//PRO MINI
|
|
|
#define CAN_CSpin 10
|
|
|
#define CAN_INTpin 3
|
|
|
+//ATMEGA
|
|
|
+//#define CAN_CSpin 53
|
|
|
+//#define CAN_INTpin 10
|
|
|
|
|
|
|
|
|
|
|
|
@@ -149,9 +154,12 @@ const TASK_TYPE_T TASK_TYPE_T_Broadcast_child_CHANGE___ = 0x12 ; //todo to repor
|
|
|
|
|
|
|
|
|
#define HX711_Broadcast_child_CHANGE__Port_ID 0x01
|
|
|
-
|
|
|
#define HX711_Broadcast_child_CHANGE__PortTypes_T PortTypes_INPUT //PortTypes_T PortTypes; //4 0xFF = 1111 1111 s
|
|
|
|
|
|
+
|
|
|
+#define HX711_Broadcast_child_CHANGE__OUTPUT__Slave_ID 0x11
|
|
|
+#define HX711_Broadcast_child_CHANGE__OUTPUT__Port_ID 5
|
|
|
+
|
|
|
#define HX711_Broadcast_child_CHANGE__TIME_MIN 100
|
|
|
|
|
|
#define HX711_Broadcast_child_CHANGE__DELTA_MIN 10000
|
|
|
@@ -180,8 +188,18 @@ void setup() {
|
|
|
Serial.print(" [CAN_OK] ");
|
|
|
} else {
|
|
|
Serial.print(" #33 [CAN_ERROR] ");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ CAN0.setMode(MCP_NORMAL); // Change to normal mode to allow messages to be transmitted
|
|
|
+ pinMode(CAN_INTpin, INPUT); // Setting pin 2 for /INT input
|
|
|
+ Serial.println(" #94 EOF MCP can setup. ");
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
|
|
|
|
|
|
// scale.set_scale(calibration_factor);
|
|
|
@@ -218,7 +236,11 @@ void loop() {
|
|
|
Broadcast_state_FULL_FRESH,// int Broadcast_state; //7
|
|
|
TASK_TYPE_T_Broadcast_child_CHANGE___};
|
|
|
|
|
|
+ // byte data[8] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
|
|
|
+
|
|
|
byte sndStat = CAN0.sendMsgBuf(Active_ControllerID, 0, 8, data);
|
|
|
+ // byte sndStat = CAN0.sendMsgBuf(0x100, 0, 8, data);
|
|
|
+
|
|
|
if(sndStat == CAN_OK){
|
|
|
Serial.println("Message Sent Successfully!");
|
|
|
} else {
|
|
|
@@ -233,7 +255,19 @@ void loop() {
|
|
|
// Serial.println(" HX711_last "); //You can change this to lbs but you'll need to refactor the calibration_factor
|
|
|
|
|
|
|
|
|
+/*
|
|
|
+ byte data[8] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
|
|
|
|
|
|
+ //byte sndStat = CAN0.sendMsgBuf(Active_ControllerID, 0, 8, data);
|
|
|
+ byte sndStat = CAN0.sendMsgBuf(0x100, 0, 8, data);
|
|
|
+
|
|
|
+ if(sndStat == CAN_OK){
|
|
|
+ Serial.println("Message 2 Sent Successfully!");
|
|
|
+ } else {
|
|
|
+ Serial.println("Error 2 Sending Message...");
|
|
|
+ }
|
|
|
+
|
|
|
+*/
|
|
|
|
|
|
}
|
|
|
|